mirror of
https://github.com/correl/mage.git
synced 2025-01-11 11:05:23 +00:00
Merge branch 'master' of https://github.com/magefree/mage.git
This commit is contained in:
commit
2a2df685a9
140 changed files with 6263 additions and 268 deletions
|
@ -357,6 +357,7 @@
|
|||
|Generate|TOK:C17|Rat|||DeathtouchRatToken|
|
||||
|Generate|TOK:C17|Vampire|||EdgarMarkovToken|
|
||||
|Generate|TOK:C17|Zombie||
|
||||
|Generate|TOK:C18|Myr|||BrudicladTelchorMyrToken|
|
||||
|Generate|TOK:CHK|Dragon Spirit|||TatsumaDragonToken|
|
||||
|Generate|TOK:CHK|Elemental|||SeedGuardianToken|
|
||||
|Generate|TOK:CHK|Illusion|||MelokuTheCloudedMirrorToken|
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.deck;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -23,6 +22,7 @@ import mage.filter.FilterMana;
|
|||
public class Commander extends Constructed {
|
||||
|
||||
protected List<String> bannedCommander = new ArrayList<>();
|
||||
protected boolean partnerAllowed = true;
|
||||
|
||||
public Commander() {
|
||||
this("Commander");
|
||||
|
@ -105,6 +105,9 @@ public class Commander extends Constructed {
|
|||
}
|
||||
|
||||
if (deck.getSideboard().size() < 1 || deck.getSideboard().size() > 2) {
|
||||
if ((deck.getSideboard().size() > 1 && !partnerAllowed)) {
|
||||
invalid.put("Commander", "You may only have one commander");
|
||||
}
|
||||
invalid.put("Commander", "Sideboard must contain only the commander(s)");
|
||||
valid = false;
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.deck;
|
||||
|
||||
/**
|
||||
|
@ -9,70 +8,49 @@ public class MTGO1v1Commander extends Commander {
|
|||
|
||||
public MTGO1v1Commander() {
|
||||
super("MTGO 1v1 Commander");
|
||||
partnerAllowed = false;
|
||||
|
||||
banned.add("Ancestral Recall");
|
||||
banned.add("Ancient Tomb");
|
||||
banned.add("Back to Basics");
|
||||
banned.add("Balance");
|
||||
banned.add("Baral, Chief of Compliance");
|
||||
banned.add("Black Lotus");
|
||||
banned.add("Braids, Cabal Minion");
|
||||
banned.add("Brainstorm");
|
||||
banned.add("Channel");
|
||||
banned.add("Chrome Mox");
|
||||
banned.add("Derevi, Empyrial Tactician");
|
||||
banned.add("Demonic Tutor");
|
||||
banned.add("Dig Through Time");
|
||||
banned.add("Doomsday");
|
||||
banned.add("Edgar Markov");
|
||||
banned.add("Edric, Spymaster of Trest");
|
||||
banned.add("Emrakul, the Aeons Torn");
|
||||
banned.add("Enlightened Tutor");
|
||||
banned.add("Entomb");
|
||||
banned.add("Erayo, Soratami Ascendant");
|
||||
banned.add("Fastbond");
|
||||
banned.add("Food Chain");
|
||||
banned.add("Gaea's Cradle");
|
||||
banned.add("Gifts Ungiven");
|
||||
banned.add("Hermit Druid");
|
||||
banned.add("Humility");
|
||||
banned.add("Imperial Seal");
|
||||
banned.add("Karakas");
|
||||
banned.add("Library of Alexandria");
|
||||
banned.add("Mana Crypt");
|
||||
banned.add("Mana Drain");
|
||||
banned.add("Mana Vault");
|
||||
banned.add("Mind Twist");
|
||||
banned.add("Moat");
|
||||
banned.add("Mox Diamond");
|
||||
banned.add("Mox Emerald");
|
||||
banned.add("Mox Jet");
|
||||
banned.add("Mox Pearl");
|
||||
banned.add("Mox Ruby");
|
||||
banned.add("Mox Sapphire");
|
||||
banned.add("Mystical Tutor");
|
||||
banned.add("Natural Order");
|
||||
banned.add("Necropotence");
|
||||
banned.add("Oath of Druids");
|
||||
banned.add("Ponder");
|
||||
banned.add("Preordain");
|
||||
banned.add("Rofellos, Llanowar Emissary");
|
||||
banned.add("Strip Mine");
|
||||
banned.add("Sensei's Divining Top");
|
||||
banned.add("Serra Ascendant");
|
||||
banned.add("Sol Ring");
|
||||
banned.add("Strip Mine");
|
||||
banned.add("Survival of the Fittest");
|
||||
banned.add("Sylvan Library");
|
||||
banned.add("Sylvan Tutor");
|
||||
banned.add("The Tabernacle at Pendrell Vale");
|
||||
banned.add("Time Vault");
|
||||
banned.add("Time Walk");
|
||||
banned.add("Tinker");
|
||||
banned.add("Tolarian Academy");
|
||||
banned.add("Treachery");
|
||||
banned.add("Treasure Cruise");
|
||||
banned.add("Vial Smasher the Fierce");
|
||||
banned.add("Vampiric Tutor");
|
||||
banned.add("Winter Orb");
|
||||
banned.add("Wordly Tutor");
|
||||
banned.add("Yamgmoth's Bargain");
|
||||
banned.add("Zur the Enchanter");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@ package mage.cards.a;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.continuous.AddChosenSubtypeEffect;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllOfChosenSubtypeEffect;
|
||||
import mage.abilities.effects.common.enterAttribute.EnterAttributeAddChosenSubtypeEffect;
|
||||
|
@ -15,8 +14,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
|
@ -42,7 +39,7 @@ public final class AdaptiveAutomaton extends CardImpl {
|
|||
ability.addEffect(new EnterAttributeAddChosenSubtypeEffect());
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AdaptiveAutomatonAddSubtypeEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AddChosenSubtypeEffect()));
|
||||
// Other creatures you control of the chosen type get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllOfChosenSubtypeEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
|
||||
}
|
||||
|
@ -57,31 +54,3 @@ public final class AdaptiveAutomaton extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl {
|
||||
|
||||
public AdaptiveAutomatonAddSubtypeEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
|
||||
staticText = "{this} is the chosen type in addition to its other types";
|
||||
}
|
||||
|
||||
public AdaptiveAutomatonAddSubtypeEffect(final AdaptiveAutomatonAddSubtypeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(permanent.getId(), game);
|
||||
if (subType != null && !permanent.hasSubtype(subType, game)) {
|
||||
permanent.getSubtype(game).add(subType);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdaptiveAutomatonAddSubtypeEffect copy() {
|
||||
return new AdaptiveAutomatonAddSubtypeEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
183
Mage.Sets/src/mage/cards/a/AminatouTheFateShifter.java
Normal file
183
Mage.Sets/src/mage/cards/a/AminatouTheFateShifter.java
Normal file
|
@ -0,0 +1,183 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceLeftOrRight;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterNonlandPermanent;
|
||||
import mage.filter.predicate.other.OwnerPredicate;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.players.PlayerList;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class AminatouTheFateShifter extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("permanent you own");
|
||||
|
||||
static {
|
||||
filter.add(new OwnerPredicate(TargetController.YOU));
|
||||
filter.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public AminatouTheFateShifter(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{W}{U}{B}");
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.AMINATOU);
|
||||
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +1: Draw a card, then put a card from your hand on top of your library.
|
||||
Ability ability = new LoyaltyAbility(new AminatouPlusEffect(), +1);
|
||||
this.addAbility(ability);
|
||||
|
||||
// -1: Exile another target permanent you own, then return it to the battlefield under your control.
|
||||
ability = new LoyaltyAbility(new ExileTargetForSourceEffect(), -1);
|
||||
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect());
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
// -6: Choose left or right. Each player gains control of all nonland permanents other than Aminatou, the
|
||||
// Fateshifter controlled by the next player in the chosen direction.
|
||||
ability = new LoyaltyAbility(new AminatouUltimateEffect(), -6);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
public AminatouTheFateShifter(final AminatouTheFateShifter card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AminatouTheFateShifter copy() {
|
||||
return new AminatouTheFateShifter(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AminatouPlusEffect extends OneShotEffect {
|
||||
public AminatouPlusEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "draw a card, then put a card from your hand on top of your library";
|
||||
}
|
||||
|
||||
public AminatouPlusEffect(final AminatouPlusEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AminatouPlusEffect copy() {
|
||||
return new AminatouPlusEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.drawCards(1, game);
|
||||
putOnLibrary(player, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean putOnLibrary(Player player, Ability source, Game game) {
|
||||
TargetCardInHand target = new TargetCardInHand();
|
||||
if (target.canChoose(source.getSourceId(), player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
|
||||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class AminatouUltimateEffect extends OneShotEffect {
|
||||
public AminatouUltimateEffect (){
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Choose left or right. Each player gains control of all nonland permanents other than Aminatou," +
|
||||
" the Fateshifter controlled by the next player in the chosen direction.";
|
||||
}
|
||||
|
||||
public AminatouUltimateEffect(final AminatouUltimateEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AminatouUltimateEffect copy(){return new AminatouUltimateEffect(this);}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Choice choice = new ChoiceLeftOrRight();
|
||||
if (!controller.choose(Outcome.Neutral, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
boolean left = choice.getChoice().equals("Left");
|
||||
PlayerList playerList = game.getState().getPlayerList().copy();
|
||||
// set playerlist to controller
|
||||
while (!playerList.get().equals(source.getControllerId())) {
|
||||
playerList.getNext();
|
||||
}
|
||||
UUID currentPlayer = playerList.get();
|
||||
UUID nextPlayer;
|
||||
UUID firstNextPlayer = null;
|
||||
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer)) {
|
||||
nextPlayer = playerList.get();
|
||||
if (nextPlayer == null) {
|
||||
return false;
|
||||
}
|
||||
// skip players out of range
|
||||
if (!game.getState().getPlayersInRange(controller.getId(), game).contains(nextPlayer)){
|
||||
continue;
|
||||
}
|
||||
// save first next player to check for iteration stop
|
||||
if (firstNextPlayer == null) {
|
||||
firstNextPlayer = nextPlayer;
|
||||
}
|
||||
FilterNonlandPermanent nextPlayerNonlandPermanentsFilter = new FilterNonlandPermanent();
|
||||
nextPlayerNonlandPermanentsFilter.add(new ControllerIdPredicate(nextPlayer));
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(nextPlayerNonlandPermanentsFilter, game)) {
|
||||
if (permanent.getId().equals(source.getSourceId())){
|
||||
continue;
|
||||
}
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, currentPlayer);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
currentPlayer = nextPlayer;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private UUID getNextPlayerInDirection(boolean left, PlayerList playerList, Game game) {
|
||||
UUID nextPlayerId;
|
||||
if (left) {
|
||||
nextPlayerId = playerList.getNext();
|
||||
} else {
|
||||
nextPlayerId = playerList.getPrevious();
|
||||
}
|
||||
return nextPlayerId;
|
||||
}
|
||||
}
|
||||
|
99
Mage.Sets/src/mage/cards/a/AncientStoneIdol.java
Normal file
99
Mage.Sets/src/mage/cards/a/AncientStoneIdol.java
Normal file
|
@ -0,0 +1,99 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.CostModificationType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.StoneTrapIdolToken;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AncientStoneIdol extends CardImpl {
|
||||
|
||||
public AncientStoneIdol(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{10}");
|
||||
|
||||
this.subtype.add(SubType.GOLEM);
|
||||
this.power = new MageInt(12);
|
||||
this.toughness = new MageInt(12);
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
|
||||
// This spell costs {1} less to cast for each attacking creature.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new AncientStoneIdolCostReductionEffect()));
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// When Ancient Stone Idol dies, create a 6/12 colorless Construct artifact creature token with trample.
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new StoneTrapIdolToken())));
|
||||
}
|
||||
|
||||
public AncientStoneIdol(final AncientStoneIdol card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AncientStoneIdol copy() {
|
||||
return new AncientStoneIdol(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AncientStoneIdolCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new AttackingPredicate());
|
||||
}
|
||||
|
||||
public AncientStoneIdolCostReductionEffect() {
|
||||
super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "This spell costs {1} less to cast for each attacking creature";
|
||||
}
|
||||
|
||||
protected AncientStoneIdolCostReductionEffect(AncientStoneIdolCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
int reductionAmount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
|
||||
CardUtil.reduceCost(abilityToModify, reductionAmount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if ((abilityToModify instanceof SpellAbility) && abilityToModify.getSourceId().equals(source.getSourceId())) {
|
||||
return game.getCard(abilityToModify.getSourceId()) != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AncientStoneIdolCostReductionEffect copy() {
|
||||
return new AncientStoneIdolCostReductionEffect(this);
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@ public final class ArgentSphinx extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Metalcraft - {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts.
|
||||
// <i>Metalcraft</i> — {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts.
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ArgentSphinxEffect(), new ManaCostsImpl("{U}"), MetalcraftCondition.instance);
|
||||
ability.setAbilityWord(AbilityWord.METALCRAFT);
|
||||
this.addAbility(ability);
|
||||
|
|
121
Mage.Sets/src/mage/cards/a/ArixmethesSlumberingIsle.java
Normal file
121
Mage.Sets/src/mage/cards/a/ArixmethesSlumberingIsle.java
Normal file
|
@ -0,0 +1,121 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import static mage.constants.Layer.TypeChangingEffects_4;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class ArixmethesSlumberingIsle extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a spell");
|
||||
|
||||
public ArixmethesSlumberingIsle(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}");
|
||||
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.KRAKEN);
|
||||
this.power = new MageInt(12);
|
||||
this.toughness = new MageInt(12);
|
||||
|
||||
// Arixmethes, Slumbering Isle enters the battlefield tapped with five slumber counters on it.
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
Effect effect = new AddCountersSourceEffect(CounterType.SLUMBER.createInstance(5));
|
||||
this.addAbility(new EntersBattlefieldAbility(effect, "with five slumber counters"));
|
||||
|
||||
// As long as Arixmethes, Slumbering Isle has a slumber counter on it, it's a land.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
|
||||
new ArixmethesIsLandEffect(),
|
||||
new SourceHasCounterCondition(CounterType.SLUMBER, 1, Integer.MAX_VALUE),
|
||||
"As long as {this} has a slumber counter on it, it's a land")));
|
||||
|
||||
// Whenever you cast a spell, you may remove a slumber counter from Arixmethes.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.SLUMBER.createInstance(1)), true));
|
||||
|
||||
// {T}: Add {G}{U}.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 1, 0, 0, 0, 0, 0), new TapSourceCost()));
|
||||
}
|
||||
|
||||
public ArixmethesSlumberingIsle(final ArixmethesSlumberingIsle card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArixmethesSlumberingIsle copy() {
|
||||
return new ArixmethesSlumberingIsle(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ArixmethesIsLandEffect extends ContinuousEffectImpl {
|
||||
|
||||
public ArixmethesIsLandEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
this.staticText = "As long as {this} has a slumber counter on it, it's a land";
|
||||
}
|
||||
|
||||
public ArixmethesIsLandEffect(final ArixmethesIsLandEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArixmethesIsLandEffect copy() {
|
||||
return new ArixmethesIsLandEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
|
||||
if (permanent != null) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.getCardType().clear();
|
||||
permanent.addCardType(CardType.LAND);
|
||||
permanent.getSubtype(game).clear();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.TypeChangingEffects_4;
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public final class AuriokEdgewright extends CardImpl {
|
||||
|
||||
protected static String effectText = "Metalcraft - Auriok Edgewright has double strike as long as you control three or more artifacts.";
|
||||
protected static String effectText = "<i>Metalcraft</i> — Auriok Edgewright has double strike as long as you control three or more artifacts.";
|
||||
|
||||
public AuriokEdgewright(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
|
||||
|
|
|
@ -23,8 +23,8 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public final class AuriokSunchaser extends CardImpl {
|
||||
|
||||
protected static String effect1Text = "Metalcraft - As long as you control three or more artifacts, Auriok Sunchaser gets +2/+2";
|
||||
protected static String effect2Text = "Metalcraft - As long as you control three or more artifacts, Auriok Sunchaser has flying";
|
||||
protected static String effect1Text = "<i>Metalcraft</i> — As long as you control three or more artifacts, Auriok Sunchaser gets +2/+2";
|
||||
protected static String effect2Text = "<i>Metalcraft</i> — As long as you control three or more artifacts, Auriok Sunchaser has flying";
|
||||
|
||||
public AuriokSunchaser(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
@ -26,7 +25,7 @@ import java.util.UUID;
|
|||
public final class Balance extends CardImpl {
|
||||
|
||||
public Balance(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}");
|
||||
|
||||
// Each player chooses a number of lands he or she controls equal to the number of lands controlled by the player who controls the fewest, then sacrifices the rest. Players discard cards and sacrifice creatures the same way.
|
||||
this.getSpellAbility().addEffect(new BalanceEffect());
|
||||
|
@ -46,7 +45,10 @@ class BalanceEffect extends OneShotEffect {
|
|||
|
||||
BalanceEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
staticText = "Each player chooses a number of lands he or she controls equal to the number of lands controlled by the player who controls the fewest, then sacrifices the rest. Players sacrifice creatures and discard cards the same way";
|
||||
staticText = "each player chooses a number of lands they control "
|
||||
+ "equal to the number of lands controlled by the player "
|
||||
+ "who controls the fewest, then sacrifices the rest. "
|
||||
+ "Players discard cards and sacrifice creatures the same way";
|
||||
}
|
||||
|
||||
BalanceEffect(final BalanceEffect effect) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public final class BelbesPortal extends CardImpl {
|
|||
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.PutCreatureInPlay)));
|
||||
// {3}, {tap}: You may put a creature card of the chosen type from your hand onto the battlefield.
|
||||
FilterCreatureCard filter = new FilterCreatureCard("a creature card of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new PutCardFromHandOntoBattlefieldEffect(filter),
|
||||
new ManaCostsImpl("{3}"));
|
||||
|
|
|
@ -22,7 +22,7 @@ import mage.constants.SubType;
|
|||
*/
|
||||
public final class BladeTribeBerserkers extends CardImpl {
|
||||
|
||||
private static final String effectText = "Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.";
|
||||
private static final String effectText = "<i>Metalcraft</i> — When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.";
|
||||
|
||||
public BladeTribeBerserkers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");
|
||||
|
@ -31,7 +31,7 @@ public final class BladeTribeBerserkers extends CardImpl {
|
|||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
//Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.
|
||||
//<i>Metalcraft</i> — When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), false);
|
||||
ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MetalcraftCondition.instance, effectText));
|
||||
|
|
|
@ -22,7 +22,7 @@ import mage.target.TargetPlayer;
|
|||
*/
|
||||
public final class BleakCovenVampires extends CardImpl {
|
||||
|
||||
private static final String effectText = "Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.";
|
||||
private static final String effectText = "<i>Metalcraft</i> — When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.";
|
||||
|
||||
public BleakCovenVampires(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
|
||||
|
@ -31,7 +31,7 @@ public final class BleakCovenVampires extends CardImpl {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
//Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.
|
||||
//<i>Metalcraft</i> — When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(4), false);
|
||||
ability.addEffect(new GainLifeEffect(4));
|
||||
Target target = new TargetPlayer();
|
||||
|
|
57
Mage.Sets/src/mage/cards/b/Bloodtracker.java
Normal file
57
Mage.Sets/src/mage/cards/b/Bloodtracker.java
Normal file
|
@ -0,0 +1,57 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.counters.CounterType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Bloodtracker extends CardImpl {
|
||||
|
||||
public Bloodtracker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
|
||||
this.subtype.add(SubType.VAMPIRE);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// {B}, Pay 2 life: Put a +1/+1 counter on Bloodtracker.
|
||||
Ability ability = new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{B}"));
|
||||
ability.addCost(new PayLifeCost(2));
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Bloodtracker leaves the battlefield, draw a card for each +1/+1 counter on it.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(new CountersSourceCount(CounterType.P1P1))
|
||||
.setText("draw a card for each +1/+1 counter on it"), false
|
||||
));
|
||||
}
|
||||
|
||||
public Bloodtracker(final Bloodtracker card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bloodtracker copy() {
|
||||
return new Bloodtracker(this);
|
||||
}
|
||||
}
|
168
Mage.Sets/src/mage/cards/b/BoreasCharger.java
Normal file
168
Mage.Sets/src/mage/cards/b/BoreasCharger.java
Normal file
|
@ -0,0 +1,168 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPlayer;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BoreasCharger extends CardImpl {
|
||||
|
||||
public BoreasCharger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
|
||||
this.subtype.add(SubType.PEGASUS);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Boreas Charger leaves the battlefield, choose an opponent who controls more lands than you. Search your library for a number of Plains cards equal to the difference and reveal them. Put one of them onto the battlefield tapped and the rest into your hand. Then shuffle your library.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(
|
||||
new BoreasChargerEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
public BoreasCharger(final BoreasCharger card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoreasCharger copy() {
|
||||
return new BoreasCharger(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BoreasChargerEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPlayer filter
|
||||
= new FilterPlayer("opponent who controls more lands than you");
|
||||
private static final FilterCard filter2
|
||||
= new FilterCard("Plains cards");
|
||||
private static final FilterCard filter3
|
||||
= new FilterCard("a card to put onto the battlefield tapped");
|
||||
|
||||
static {
|
||||
filter.add(new BoreasChargerPredicate());
|
||||
filter2.add(new SubtypePredicate(SubType.PLAINS));
|
||||
}
|
||||
|
||||
public BoreasChargerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "choose an opponent who controls more lands than you. "
|
||||
+ "Search your library for a number of Plains cards "
|
||||
+ "equal to the difference and reveal them. "
|
||||
+ "Put one of them onto the battlefield tapped "
|
||||
+ "and the rest into your hand. Then shuffle your library";
|
||||
}
|
||||
|
||||
public BoreasChargerEffect(final BoreasChargerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoreasChargerEffect copy() {
|
||||
return new BoreasChargerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getSourceId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
TargetPlayer target = new TargetPlayer(1, 1, true, filter);
|
||||
controller.choose(outcome, target, source.getSourceId(), game);
|
||||
Player opponent = game.getPlayer(target.getFirstTarget());
|
||||
if (opponent == null) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
return false;
|
||||
}
|
||||
int landDifference = game.getBattlefield().getAllActivePermanents(
|
||||
StaticFilters.FILTER_LANDS, opponent.getId(), game
|
||||
).size();
|
||||
landDifference -= game.getBattlefield().getAllActivePermanents(
|
||||
StaticFilters.FILTER_LANDS, controller.getId(), game
|
||||
).size();
|
||||
landDifference = Math.abs(landDifference);
|
||||
TargetCardInLibrary target2
|
||||
= new TargetCardInLibrary(0, landDifference, filter2);
|
||||
Cards cardsToHand = new CardsImpl();
|
||||
if (controller.searchLibrary(target2, game)) {
|
||||
for (UUID cardId : target2.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
cardsToHand.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cardsToHand.isEmpty()) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
TargetCard target3 = new TargetCard(Zone.LIBRARY, filter3);
|
||||
Card cardToBattlefield = null;
|
||||
if (controller.choose(outcome, cardsToHand, target3, game)) {
|
||||
cardToBattlefield = cardsToHand.get(target2.getFirstTarget(), game);
|
||||
cardsToHand.remove(cardToBattlefield);
|
||||
}
|
||||
if (cardToBattlefield != null) {
|
||||
controller.moveCards(
|
||||
cardToBattlefield, Zone.BATTLEFIELD, source, game,
|
||||
true, false, true, null
|
||||
);
|
||||
}
|
||||
controller.moveCards(cardsToHand, Zone.HAND, source, game);
|
||||
controller.shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class BoreasChargerPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
||||
Player targetPlayer = input.getObject();
|
||||
UUID playerId = input.getPlayerId();
|
||||
if (targetPlayer == null || playerId == null) {
|
||||
return false;
|
||||
}
|
||||
if (!targetPlayer.hasOpponent(playerId, game)) {
|
||||
return false;
|
||||
}
|
||||
int countTargetPlayer = game.getBattlefield().countAll(
|
||||
StaticFilters.FILTER_LANDS, targetPlayer.getId(), game
|
||||
);
|
||||
int countController = game.getBattlefield().countAll(
|
||||
StaticFilters.FILTER_LANDS, playerId, game
|
||||
);
|
||||
|
||||
return countTargetPlayer > countController;
|
||||
}
|
||||
}
|
|
@ -69,7 +69,7 @@ class BrassHeraldEntersEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterCard filter = new FilterCard("creature cards of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(source.getSourceId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
return new RevealLibraryPutIntoHandEffect(4, filter, Zone.LIBRARY).apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public final class BrimstoneVolley extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||
|
||||
// Brimstone Volley deals 3 damage to any target.
|
||||
// Morbid - Brimstone Volley deals 5 damage to that creature or player instead if a creature died this turn.
|
||||
// <i>Morbid</i> — Brimstone Volley deals 5 damage to that creature or player instead if a creature died this turn.
|
||||
this.getSpellAbility().addEffect(new BrimstoneVolleyEffect());
|
||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class BrimstoneVolleyEffect extends OneShotEffect {
|
|||
|
||||
public BrimstoneVolleyEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "{this} deals 3 damage to any target.\n Morbid - {this} deals 5 damage to that permanent or player instead if a creature died this turn";
|
||||
staticText = "{this} deals 3 damage to any target.\n <i>Morbid</i> — {this} deals 5 damage to that permanent or player instead if a creature died this turn";
|
||||
}
|
||||
|
||||
public BrimstoneVolleyEffect(final BrimstoneVolleyEffect effect) {
|
||||
|
|
113
Mage.Sets/src/mage/cards/b/BrudicladTelchorEngineer.java
Normal file
113
Mage.Sets/src/mage/cards/b/BrudicladTelchorEngineer.java
Normal file
|
@ -0,0 +1,113 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.BrudicladTelchorMyrToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.util.functions.EmptyApplyToPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class BrudicladTelchorEngineer extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature tokens you control");
|
||||
|
||||
static {
|
||||
filter.add(new TokenPredicate());
|
||||
}
|
||||
|
||||
public BrudicladTelchorEngineer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{U}{R}");
|
||||
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ARTIFICER);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Creature tokens you control have haste.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true)));
|
||||
|
||||
// At the beginning of combat on your turn, create a 2/1 blue Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token.
|
||||
this.addAbility(new BeginningOfCombatTriggeredAbility(new BrudicladTelchorCombatffect(), TargetController.YOU, false));
|
||||
}
|
||||
|
||||
public BrudicladTelchorEngineer(final BrudicladTelchorEngineer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrudicladTelchorEngineer copy() {
|
||||
return new BrudicladTelchorEngineer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BrudicladTelchorCombatffect extends OneShotEffect {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent(" token you control. If you do, each other token you control becomes a copy of that token");
|
||||
|
||||
static {
|
||||
filter.add(new TokenPredicate());
|
||||
}
|
||||
|
||||
public BrudicladTelchorCombatffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = " you may choose a token you control. If you do, each other token you control becomes a copy of that token";
|
||||
}
|
||||
|
||||
public BrudicladTelchorCombatffect(final BrudicladTelchorCombatffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrudicladTelchorCombatffect copy() {
|
||||
return new BrudicladTelchorCombatffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new BrudicladTelchorMyrToken(), 1);
|
||||
|
||||
if (effect.apply(game, source)) {
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(0, 1, filter, true);
|
||||
target.setNotTarget(true);
|
||||
if (controller.choose(Outcome.Neutral, target, source.getSourceId(), game)) {
|
||||
Permanent toCopyFromPermanent = game.getPermanent(target.getFirstTarget());
|
||||
|
||||
if (toCopyFromPermanent != null) {
|
||||
for (Permanent toCopyToPermanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
if (!toCopyToPermanent.equals(toCopyFromPermanent)) {
|
||||
game.copyPermanent(toCopyFromPermanent, toCopyToPermanent.getId(), source, new EmptyApplyToPermanent());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -49,7 +49,7 @@ public final class CallerOfTheHunt extends CardImpl {
|
|||
if (mageObject != null
|
||||
&& effect.apply(game, ability)) {
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(new ChosenSubtypePredicate(mageObject.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
ContinuousEffect effectPower = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.Custom);
|
||||
ContinuousEffect effectToughness = new SetToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.Custom);
|
||||
game.addEffect(effectPower, ability);
|
||||
|
|
|
@ -21,7 +21,7 @@ import mage.constants.Zone;
|
|||
* @author Loki
|
||||
*/
|
||||
public final class CarapaceForger extends CardImpl {
|
||||
private static final String text = "Metalcraft - Carapace Forger gets +2/+2 as long as you control three or more artifacts";
|
||||
private static final String text = "<i>Metalcraft</i> — Carapace Forger gets +2/+2 as long as you control three or more artifacts";
|
||||
|
||||
public CarapaceForger (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}");
|
||||
|
|
|
@ -26,7 +26,7 @@ public final class CaravanVigil extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}");
|
||||
|
||||
// Search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.
|
||||
// Morbid - You may put that card onto the battlefield instead of putting it into your hand if a creature died this turn.
|
||||
// <i>Morbid</i> — You may put that card onto the battlefield instead of putting it into your hand if a creature died this turn.
|
||||
this.getSpellAbility().addEffect(new CaravanVigilEffect());
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import mage.constants.Zone;
|
|||
* @author Loki
|
||||
*/
|
||||
public final class ChromeSteed extends CardImpl {
|
||||
private static final String text = "Metalcraft - Chrome Steed gets +2/+2 as long as you control three or more artifacts";
|
||||
private static final String text = "<i>Metalcraft</i> — Chrome Steed gets +2/+2 as long as you control three or more artifacts";
|
||||
|
||||
public ChromeSteed (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}");
|
||||
|
|
|
@ -29,7 +29,7 @@ public final class ConcussiveBolt extends CardImpl {
|
|||
// Concussive Bolt deals 4 damage to target player.
|
||||
this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
|
||||
// Metalcraft - If you control three or more artifacts, creatures that player controls can't block this turn.
|
||||
// <i>Metalcraft</i> — If you control three or more artifacts, creatures that player controls can't block this turn.
|
||||
this.getSpellAbility().addEffect(new ConcussiveBoltEffect());
|
||||
this.getSpellAbility().addEffect(new ConcussiveBoltRestrictionEffect());
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class ConcussiveBoltEffect extends OneShotEffect {
|
|||
|
||||
public ConcussiveBoltEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Metalcraft - If you control three or more artifacts, creatures controlled by that player or by that planeswalker's controller can't block this turn.";
|
||||
this.staticText = "<i>Metalcraft</i> — If you control three or more artifacts, creatures controlled by that player or by that planeswalker's controller can't block this turn.";
|
||||
}
|
||||
|
||||
public ConcussiveBoltEffect(final ConcussiveBoltEffect effect) {
|
||||
|
|
135
Mage.Sets/src/mage/cards/c/CovetedJewel.java
Normal file
135
Mage.Sets/src/mage/cards/c/CovetedJewel.java
Normal file
|
@ -0,0 +1,135 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.UntapSourceEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CovetedJewel extends CardImpl {
|
||||
|
||||
public CovetedJewel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
|
||||
|
||||
// When Coveted Jewel enters the battlefield, draw three cards.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(3)
|
||||
));
|
||||
|
||||
// {T}: Add three mana of any one color.
|
||||
this.addAbility(new SimpleManaAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new AddManaOfAnyColorEffect(3),
|
||||
new TapSourceCost()
|
||||
));
|
||||
|
||||
// Whenever one or more creatures an opponent controls attack you and aren't blocked, that player draws three cards and gains control of Coveted Jewel. Untap it.
|
||||
this.addAbility(new CovetedJewelTriggeredAbility());
|
||||
}
|
||||
|
||||
public CovetedJewel(final CovetedJewel card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CovetedJewel copy() {
|
||||
return new CovetedJewel(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CovetedJewelTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public CovetedJewelTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardTargetEffect(3), false);
|
||||
this.addEffect(new CovetedJewelEffect());
|
||||
this.addEffect(new UntapSourceEffect());
|
||||
}
|
||||
|
||||
public CovetedJewelTriggeredAbility(final CovetedJewelTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CovetedJewelTriggeredAbility copy() {
|
||||
return new CovetedJewelTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DECLARE_BLOCKERS_STEP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Player player = game.getPlayer(this.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
for (UUID attacker : game.getCombat().getAttackers()) {
|
||||
Permanent creature = game.getPermanent(attacker);
|
||||
if (creature != null
|
||||
&& player.hasOpponent(creature.getControllerId(), game)
|
||||
&& player.getId().equals(game.getCombat().getDefendingPlayerId(attacker, game))
|
||||
&& !creature.isBlocked(game)) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(this.getControllerId(), game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever one or more creatures an opponent controls attack you "
|
||||
+ "and aren't blocked, that player draws three cards "
|
||||
+ "and gains control of {this}. Untap it.";
|
||||
}
|
||||
}
|
||||
|
||||
class CovetedJewelEffect extends ContinuousEffectImpl {
|
||||
|
||||
public CovetedJewelEffect() {
|
||||
super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
|
||||
}
|
||||
|
||||
public CovetedJewelEffect(final CovetedJewelEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CovetedJewelEffect copy() {
|
||||
return new CovetedJewelEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
return permanent.changeControllerId(source.getFirstTarget(), game);
|
||||
}
|
||||
}
|
59
Mage.Sets/src/mage/cards/c/CrashOfRhinoBeetles.java
Normal file
59
Mage.Sets/src/mage/cards/c/CrashOfRhinoBeetles.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CrashOfRhinoBeetles extends CardImpl {
|
||||
|
||||
public CrashOfRhinoBeetles(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
|
||||
|
||||
this.subtype.add(SubType.INSECT);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Crash of Rhino Beetles gets +10/+10 as long as you control ten or more lands.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new ConditionalContinuousEffect(
|
||||
new BoostSourceEffect(
|
||||
10, 10, Duration.WhileOnBattlefield
|
||||
),
|
||||
new PermanentsOnTheBattlefieldCondition(
|
||||
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND,
|
||||
ComparisonType.MORE_THAN, 9
|
||||
),
|
||||
"{this} gets +10/+10 as long as you control ten or more lands"
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public CrashOfRhinoBeetles(final CrashOfRhinoBeetles card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrashOfRhinoBeetles copy() {
|
||||
return new CrashOfRhinoBeetles(this);
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ public final class DeathreapRitual extends CardImpl {
|
|||
public DeathreapRitual(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{G}");
|
||||
|
||||
// Morbid - At the beginning of each end step, if a creature died this turn, you may draw a card.
|
||||
// <i>Morbid</i> — At the beginning of each end step, if a creature died this turn, you may draw a card.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1),
|
||||
TargetController.ANY, MorbidCondition.instance, true));
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public final class Dispatch extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}");
|
||||
|
||||
this.getSpellAbility().addEffect(new TapTargetEffect());
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ExileTargetEffect(), MetalcraftCondition.instance, "Metalcraft - If you control three or more artifacts, exile that creature"));
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ExileTargetEffect(), MetalcraftCondition.instance, "<i>Metalcraft</i> — If you control three or more artifacts, exile that creature"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public final class DispenseJustice extends CardImpl {
|
|||
class DispenseJusticeEffect extends OneShotEffect {
|
||||
|
||||
private static final String effectText = "Target player sacrifices an attacking creature.\r\n\r\n"
|
||||
+ "Metalcraft - That player sacrifices two attacking creatures instead if you control three or more artifacts";
|
||||
+ "<i>Metalcraft</i> — That player sacrifices two attacking creatures instead if you control three or more artifacts";
|
||||
|
||||
private static final FilterAttackingCreature filter = new FilterAttackingCreature();
|
||||
|
||||
|
|
36
Mage.Sets/src/mage/cards/e/EchoStorm.java
Normal file
36
Mage.Sets/src/mage/cards/e/EchoStorm.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.keyword.CommanderStormAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EchoStorm extends CardImpl {
|
||||
|
||||
public EchoStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{U}");
|
||||
|
||||
// When you cast this spell, copy it for each time you've cast your commander from the command zone this game. You may choose new targets for the copies.
|
||||
this.addAbility(new CommanderStormAbility());
|
||||
|
||||
// Create a token that's a copy of target artifact.
|
||||
this.getSpellAbility().addEffect(new CreateTokenCopyTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
|
||||
}
|
||||
|
||||
public EchoStorm(final EchoStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EchoStorm copy() {
|
||||
return new EchoStorm(this);
|
||||
}
|
||||
}
|
35
Mage.Sets/src/mage/cards/e/EmpyrialStorm.java
Normal file
35
Mage.Sets/src/mage/cards/e/EmpyrialStorm.java
Normal file
|
@ -0,0 +1,35 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.CommanderStormAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.permanent.token.AngelToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EmpyrialStorm extends CardImpl {
|
||||
|
||||
public EmpyrialStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}{W}");
|
||||
|
||||
// When you cast this spell, copy it for each time you've cast your commander from the command zone this game.
|
||||
this.addAbility(new CommanderStormAbility());
|
||||
|
||||
// Create a 4/4 white Angel creature token with flying.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken()));
|
||||
}
|
||||
|
||||
public EmpyrialStorm(final EmpyrialStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpyrialStorm copy() {
|
||||
return new EmpyrialStorm(this);
|
||||
}
|
||||
}
|
74
Mage.Sets/src/mage/cards/e/EndlessAtlas.java
Normal file
74
Mage.Sets/src/mage/cards/e/EndlessAtlas.java
Normal file
|
@ -0,0 +1,74 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EndlessAtlas extends CardImpl {
|
||||
|
||||
public EndlessAtlas(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
|
||||
// {2}, {T}: Draw a card. Activate this ability only if you control three or more lands with the same name.
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
new GenericManaCost(2),
|
||||
new EndlessAtlasCondition()
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public EndlessAtlas(final EndlessAtlas card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndlessAtlas copy() {
|
||||
return new EndlessAtlas(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EndlessAtlasCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Map<String, Integer> landMap = new HashMap();
|
||||
for (Permanent land : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND,
|
||||
source.getControllerId(), game
|
||||
)) {
|
||||
if (land != null) {
|
||||
int landCount = landMap.getOrDefault(land.getName(), 0);
|
||||
if (landCount > 1) {
|
||||
return true;
|
||||
}
|
||||
landMap.put(land.getName(), landCount + 1);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you control three or more lands with the same name";
|
||||
}
|
||||
}
|
59
Mage.Sets/src/mage/cards/e/EntreatTheDead.java
Normal file
59
Mage.Sets/src/mage/cards/e/EntreatTheDead.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.keyword.MiracleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EntreatTheDead extends CardImpl {
|
||||
|
||||
public EntreatTheDead(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{B}{B}{B}");
|
||||
|
||||
// Return X target creature cards from your graveyard to the battlefield.
|
||||
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(1, StaticFilters.FILTER_CARD_CREATURE));
|
||||
|
||||
// Miracle {X}{B}{B}
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{X}{B}{B}")));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability instanceof SpellAbility) {
|
||||
ability.getTargets().clear();
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
String filterName = xValue
|
||||
+ (xValue != 1 ? " creature cards" : "creature card")
|
||||
+ " from your graveyard";
|
||||
Target target = new TargetCardInYourGraveyard(
|
||||
xValue, new FilterCreatureCard(filterName)
|
||||
);
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
||||
public EntreatTheDead(final EntreatTheDead card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntreatTheDead copy() {
|
||||
return new EntreatTheDead(this);
|
||||
}
|
||||
}
|
160
Mage.Sets/src/mage/cards/e/EstridTheMasked.java
Normal file
160
Mage.Sets/src/mage/cards/e/EstridTheMasked.java
Normal file
|
@ -0,0 +1,160 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect;
|
||||
import mage.abilities.effects.common.UntapAllControllerEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterEnchantmentCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.EnchantedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.MaskToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EstridTheMasked extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent();
|
||||
private static final FilterPermanent filter2 = new FilterPermanent("another permanent");
|
||||
|
||||
static {
|
||||
filter.add(new EnchantedPredicate());
|
||||
filter2.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public EstridTheMasked(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{G}{W}{U}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ESTRID);
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +2: Untap each enchanted permanent you control.
|
||||
this.addAbility(new LoyaltyAbility(new UntapAllControllerEffect(
|
||||
filter, "untap each enchanted permanent you control"
|
||||
), 2));
|
||||
|
||||
// -1: Create a white Aura enchantment token named Mask attached to another target permanent. The token has enchant permanent and totem armor.
|
||||
Ability ability = new LoyaltyAbility(
|
||||
new EstridTheMaskedTokenEffect(), -1
|
||||
);
|
||||
ability.addTarget(new TargetPermanent(filter2));
|
||||
this.addAbility(ability);
|
||||
|
||||
// -7: Put the top seven cards of your library into your graveyard. Return all non-Aura enchantment cards from your graveyard to the battlefield, then do the same for Aura cards.
|
||||
this.addAbility(new LoyaltyAbility(
|
||||
new EstridTheMaskedGraveyardEffect(), -7
|
||||
));
|
||||
|
||||
// Estrid, the Masked can be your commander.
|
||||
this.addAbility(CanBeYourCommanderAbility.getInstance());
|
||||
}
|
||||
|
||||
public EstridTheMasked(final EstridTheMasked card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EstridTheMasked copy() {
|
||||
return new EstridTheMasked(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EstridTheMaskedTokenEffect extends OneShotEffect {
|
||||
|
||||
public EstridTheMaskedTokenEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "create a white Aura enchantment token named Mask "
|
||||
+ "attached to another target permanent. "
|
||||
+ "The token has enchant permanent and totem armor";
|
||||
}
|
||||
|
||||
public EstridTheMaskedTokenEffect(final EstridTheMaskedTokenEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EstridTheMaskedTokenEffect copy() {
|
||||
return new EstridTheMaskedTokenEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new MaskToken());
|
||||
effect.apply(game, source);
|
||||
for (UUID tokenId : effect.getLastAddedTokenIds()) {
|
||||
Permanent token = game.getPermanent(tokenId);
|
||||
if (token == null) {
|
||||
continue;
|
||||
}
|
||||
token.attachTo(source.getFirstTarget(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class EstridTheMaskedGraveyardEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterEnchantmentCard filter
|
||||
= new FilterEnchantmentCard();
|
||||
private static final FilterEnchantmentCard filter2
|
||||
= new FilterEnchantmentCard();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new SubtypePredicate(SubType.AURA)));
|
||||
filter.add(new SubtypePredicate(SubType.AURA));
|
||||
}
|
||||
|
||||
public EstridTheMaskedGraveyardEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "put the top seven cards of your library "
|
||||
+ "into your graveyard. Return all non-Aura enchantment cards "
|
||||
+ "from your graveyard to the battlefield, "
|
||||
+ "then do the same for Aura cards";
|
||||
}
|
||||
|
||||
public EstridTheMaskedGraveyardEffect(final EstridTheMaskedGraveyardEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EstridTheMaskedGraveyardEffect copy() {
|
||||
return new EstridTheMaskedGraveyardEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
new PutTopCardOfLibraryIntoGraveControllerEffect(7).apply(game, source);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
controller.moveCards(controller.getGraveyard().getCards(
|
||||
filter, source.getSourceId(), source.getControllerId(), game
|
||||
), Zone.BATTLEFIELD, source, game);
|
||||
controller.moveCards(controller.getGraveyard().getCards(
|
||||
filter2, source.getSourceId(), source.getControllerId(), game
|
||||
), Zone.BATTLEFIELD, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
105
Mage.Sets/src/mage/cards/e/EstridsInvocation.java
Normal file
105
Mage.Sets/src/mage/cards/e/EstridsInvocation.java
Normal file
|
@ -0,0 +1,105 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EstridsInvocation extends CardImpl {
|
||||
|
||||
public EstridsInvocation(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||
|
||||
// You may have Estrid's Invocation enter the battlefield as a copy of any enchantment you control, except it gains "At the beginning of your upkeep, you may exile this enchantment. If you do, return it to the battlefield under its owner's control."
|
||||
this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(
|
||||
StaticFilters.FILTER_ENCHANTMENT_PERMANENT,
|
||||
new EstridsInvocationApplier()
|
||||
).setText("as a copy of any enchantment you control, except it gains "
|
||||
+ "\"At the beginning of your upkeep, "
|
||||
+ "you may exile this enchantment. "
|
||||
+ "If you do, return it to the battlefield "
|
||||
+ "under its owner's control.\""), true
|
||||
));
|
||||
}
|
||||
|
||||
public EstridsInvocation(final EstridsInvocation card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EstridsInvocation copy() {
|
||||
return new EstridsInvocation(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EstridsInvocationApplier extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
// At the beginning of your upkeep, you may exile this enchantment. If you do, return it to the battlefield under its owner's control.
|
||||
permanent.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new EstridsInvocationEffect(), TargetController.YOU, true
|
||||
), source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
// At the beginning of your upkeep, you may exile this enchantment. If you do, return it to the battlefield under its owner's control.
|
||||
mageObject.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(
|
||||
new EstridsInvocationEffect(), TargetController.YOU, true
|
||||
));
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class EstridsInvocationEffect extends OneShotEffect {
|
||||
|
||||
public EstridsInvocationEffect() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "you may exile this enchantment. "
|
||||
+ "If you do, return it to the battlefield under its owner's control";
|
||||
}
|
||||
|
||||
public EstridsInvocationEffect(final EstridsInvocationEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EstridsInvocationEffect copy() {
|
||||
return new EstridsInvocationEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Estrid's Invocation", source.getSourceId(), game)) {
|
||||
Card card = game.getExile().getCard(source.getSourceId(), game);
|
||||
if (card != null) {
|
||||
return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
81
Mage.Sets/src/mage/cards/e/EverWatchingThreshold.java
Normal file
81
Mage.Sets/src/mage/cards/e/EverWatchingThreshold.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EverWatchingThreshold extends CardImpl {
|
||||
|
||||
public EverWatchingThreshold(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||
|
||||
// Whenever an opponent attacks you and/or a planeswalker you control with one or more creatures, draw a card.
|
||||
this.addAbility(new EverWatchingThresholdTriggeredAbility());
|
||||
}
|
||||
|
||||
public EverWatchingThreshold(final EverWatchingThreshold card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EverWatchingThreshold copy() {
|
||||
return new EverWatchingThreshold(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EverWatchingThresholdTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public EverWatchingThresholdTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
|
||||
}
|
||||
|
||||
public EverWatchingThresholdTriggeredAbility(final EverWatchingThresholdTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EverWatchingThresholdTriggeredAbility copy() {
|
||||
return new EverWatchingThresholdTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Player player = game.getPlayer(this.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
for (UUID attacker : game.getCombat().getAttackers()) {
|
||||
Permanent creature = game.getPermanent(attacker);
|
||||
if (creature != null
|
||||
&& player.hasOpponent(creature.getControllerId(), game)
|
||||
&& player.getId().equals(game.getCombat().getDefendingPlayerId(attacker, game))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent attacks you "
|
||||
+ "and/or a planeswalker you control "
|
||||
+ "with one or more creatures, draw a card.";
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ import mage.constants.Zone;
|
|||
* @author Loki
|
||||
*/
|
||||
public final class EzurisBrigade extends CardImpl {
|
||||
private static final String text = "Metalcraft - As long as you control three or more artifacts, Ezuri's Brigade gets +4/+4 and has trample";
|
||||
private static final String text = "<i>Metalcraft</i> — As long as you control three or more artifacts, Ezuri's Brigade gets +4/+4 and has trample";
|
||||
|
||||
public EzurisBrigade (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class FesterhideBoar extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
// Morbid - Festerhide Boar enters the battlefield with two +1/+1 counters on it if a creature died this turn.
|
||||
// <i>Morbid</i> — Festerhide Boar enters the battlefield with two +1/+1 counters on it if a creature died this turn.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
MorbidCondition.instance, ""), "with two +1/+1 counters on it if a creature died this turn"));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -25,16 +24,20 @@ import mage.players.Player;
|
|||
public final class FreneticEfreet extends CardImpl {
|
||||
|
||||
public FreneticEfreet(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}");
|
||||
this.subtype.add(SubType.EFREET);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// {0}: Flip a coin. If you win the flip, Frenetic Efreet phases out. If you lose the flip, sacrifice Frenetic Efreet.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new FreneticEfreetEffect(), new GenericManaCost(0)));
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new FreneticEfreetEffect(),
|
||||
new GenericManaCost(0)
|
||||
));
|
||||
}
|
||||
|
||||
public FreneticEfreet(final FreneticEfreet card) {
|
||||
|
@ -50,8 +53,9 @@ public final class FreneticEfreet extends CardImpl {
|
|||
class FreneticEfreetEffect extends OneShotEffect {
|
||||
|
||||
public FreneticEfreetEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "Flip a coin. If you win the flip, {this} phases out. If you lose the flip, sacrifice {this}";
|
||||
super(Outcome.Neutral);
|
||||
staticText = "Flip a coin. If you win the flip, "
|
||||
+ "{this} phases out. If you lose the flip, sacrifice {this}";
|
||||
}
|
||||
|
||||
public FreneticEfreetEffect(FreneticEfreetEffect effect) {
|
||||
|
@ -62,15 +66,19 @@ class FreneticEfreetEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && permanent != null) {
|
||||
if (controller.flipCoin(game)) {
|
||||
return permanent.phaseOut(game);
|
||||
} else {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
boolean flip = controller.flipCoin(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (flip) {
|
||||
return permanent.phaseOut(game);
|
||||
} else {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
37
Mage.Sets/src/mage/cards/f/FuryStorm.java
Normal file
37
Mage.Sets/src/mage/cards/f/FuryStorm.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.CopyTargetSpellEffect;
|
||||
import mage.abilities.keyword.CommanderStormAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class FuryStorm extends CardImpl {
|
||||
|
||||
public FuryStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}{R}");
|
||||
|
||||
// When you cast this spell, copy it for each time you've cast your commander from the command zone this game. You may choose new targets for the copies.
|
||||
this.addAbility(new CommanderStormAbility());
|
||||
|
||||
// Copy target instant or sorcery spell. You may choose new targets for the copy.
|
||||
this.getSpellAbility().addEffect(new CopyTargetSpellEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY));
|
||||
}
|
||||
|
||||
public FuryStorm(final FuryStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuryStorm copy() {
|
||||
return new FuryStorm(this);
|
||||
}
|
||||
}
|
|
@ -16,14 +16,14 @@ import mage.target.common.TargetAnyTarget;
|
|||
*/
|
||||
public final class GalvanicBlast extends CardImpl {
|
||||
|
||||
private static final String effectText = "{this} deals 2 damage to anytarget.<br>Metalcraft - {this} deals 4 damage to that permanent or player instead if you control three or more artifacts";
|
||||
private static final String effectText = "{this} deals 2 damage to anytarget.<br><i>Metalcraft</i> — {this} deals 4 damage to that permanent or player instead if you control three or more artifacts";
|
||||
|
||||
public GalvanicBlast(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
|
||||
this.color.setRed(true);
|
||||
|
||||
// Galvanic Blast deals 2 damage to any target.
|
||||
// Metalcraft - Galvanic Blast deals 4 damage to that creature or player instead if you control three or more artifacts.
|
||||
// <i>Metalcraft</i> — Galvanic Blast deals 4 damage to that creature or player instead if you control three or more artifacts.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(4), new DamageTargetEffect(2), MetalcraftCondition.instance, effectText));
|
||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||
}
|
||||
|
|
91
Mage.Sets/src/mage/cards/g/GenesisStorm.java
Normal file
91
Mage.Sets/src/mage/cards/g/GenesisStorm.java
Normal file
|
@ -0,0 +1,91 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.CommanderStormAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class GenesisStorm extends CardImpl {
|
||||
|
||||
public GenesisStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}");
|
||||
|
||||
// When you cast this spell, copy it for each time you've cast your commander from the command zone this game.
|
||||
this.addAbility(new CommanderStormAbility());
|
||||
|
||||
// Reveal cards from the top of your library until you reveal a nonland permanent card. You may put that card onto the battlefield. Then put all cards revealed this way that weren't put onto the battlefield on the bottom of your library in a random order.
|
||||
this.getSpellAbility().addEffect(new GenesisStormEffect());
|
||||
}
|
||||
|
||||
public GenesisStorm(final GenesisStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenesisStorm copy() {
|
||||
return new GenesisStorm(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GenesisStormEffect extends OneShotEffect {
|
||||
|
||||
public GenesisStormEffect() {
|
||||
super(Outcome.PlayForFree);
|
||||
this.staticText = "reveal cards from the top of your library "
|
||||
+ "until you reveal a nonland permanent card. "
|
||||
+ "You may put that card onto the battlefield. "
|
||||
+ "Then put all cards revealed this way "
|
||||
+ "that weren't put onto the battlefield "
|
||||
+ "on the bottom of your library in a random order";
|
||||
}
|
||||
|
||||
public GenesisStormEffect(GenesisStormEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Cards toReveal = new CardsImpl();
|
||||
Card nonLandCard = null;
|
||||
for (Card card : controller.getLibrary().getCards(game)) {
|
||||
toReveal.add(card);
|
||||
if (card.isPermanent() && !card.isLand()) {
|
||||
nonLandCard = card;
|
||||
break;
|
||||
}
|
||||
}
|
||||
controller.revealCards(source, toReveal, game);
|
||||
if (nonLandCard != null && controller.chooseUse(
|
||||
outcome, "Put " + nonLandCard.getLogName()
|
||||
+ " onto the battlefield?", source, game
|
||||
)) {
|
||||
controller.moveCards(nonLandCard, Zone.BATTLEFIELD, source, game);
|
||||
toReveal.remove(nonLandCard);
|
||||
}
|
||||
controller.putCardsOnBottomOfLibrary(toReveal, game, source, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenesisStormEffect copy() {
|
||||
return new GenesisStormEffect(this);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public final class GhalmasWarden extends CardImpl {
|
||||
|
||||
private static final String text = "Metalcraft - Ghalma's Warden gets +2/+2 as long as you control three or more artifacts";
|
||||
private static final String text = "<i>Metalcraft</i> — Ghalma's Warden gets +2/+2 as long as you control three or more artifacts";
|
||||
|
||||
public GhalmasWarden (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class GravetillerWurm extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
// Morbid - Gravetiller Wurm enters the battlefield with four +1/+1 counters on it if a creature died this turn.
|
||||
// <i>Morbid</i> — Gravetiller Wurm enters the battlefield with four +1/+1 counters on it if a creature died this turn.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),
|
||||
MorbidCondition.instance, ""), "with four +1/+1 counters on it if a creature died this turn"));
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ public final class GruesomeDiscovery extends CardImpl {
|
|||
|
||||
|
||||
// Target player discards two cards.
|
||||
// Morbid - If a creature died this turn, instead that player reveals their hand, you choose two cards from it, then that player discards those cards.
|
||||
// <i>Morbid</i> — If a creature died this turn, instead that player reveals their hand, you choose two cards from it, then that player discards those cards.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new GruesomeDiscoveryEffect(),
|
||||
new DiscardTargetEffect(2),
|
||||
MorbidCondition.instance,
|
||||
"Target player discards two cards. Morbid - If a creature died this turn, instead that player reveals their hand, you choose two cards from it, then that player discards those cards"));
|
||||
"Target player discards two cards. <i>Morbid</i> — If a creature died this turn, instead that player reveals their hand, you choose two cards from it, then that player discards those cards"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
|
|
129
Mage.Sets/src/mage/cards/g/GyrusWakerOfCorpses.java
Normal file
129
Mage.Sets/src/mage/cards/g/GyrusWakerOfCorpses.java
Normal file
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.ManaSpentToCastCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
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.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Will
|
||||
*/
|
||||
public final class GyrusWakerOfCorpses extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("target creature card with lesser power from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new GyrusWakerOfCorpsesPowerLessThanSourcePredicate());
|
||||
}
|
||||
|
||||
public GyrusWakerOfCorpses(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{B}{R}{G}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HYDRA);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Gyrus, Walker of Corpses enters the battlefield with a number of +1/+1 counters on it equal to the amount of mana spent to cast it.
|
||||
Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new ManaSpentToCastCount(), true);
|
||||
effect.setText("with a number of +1/+1 counters on it equal to the amount of mana spent to cast it");
|
||||
this.addAbility(new EntersBattlefieldAbility(effect));
|
||||
|
||||
// Whenever Gyrus attacks, you may exile target creature card with lesser power from your graveyard. If you do, create a token that’s a copy of that card and that’s tapped and attacking. Exile the token at the end of combat.
|
||||
Ability ability = new AttacksTriggeredAbility(new GyrusWakerOfCorpsesEffect(), true);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public GyrusWakerOfCorpses(final GyrusWakerOfCorpses card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GyrusWakerOfCorpses copy() {
|
||||
return new GyrusWakerOfCorpses(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GyrusWakerOfCorpsesEffect extends OneShotEffect {
|
||||
|
||||
public GyrusWakerOfCorpsesEffect() {
|
||||
super(Outcome.Copy);
|
||||
this.staticText = "exile target creature card with lesser power from your graveyard. If you do, create a token that’s a copy of that card and that’s tapped and attacking. Exile the token at the end of combat.";
|
||||
}
|
||||
|
||||
public GyrusWakerOfCorpsesEffect(final GyrusWakerOfCorpsesEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GyrusWakerOfCorpsesEffect copy() {
|
||||
return new GyrusWakerOfCorpsesEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null || card == null) {
|
||||
return false;
|
||||
}
|
||||
controller.moveCards(card, Zone.EXILED, source, game);
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true, 1, true, true);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.apply(game, source);
|
||||
for (Permanent addedToken : effect.getAddedPermanent()) {
|
||||
Effect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(addedToken, game));
|
||||
new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), false).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class GyrusWakerOfCorpsesPowerLessThanSourcePredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Card>> {
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(input.getSourceId());
|
||||
return sourcePermanent != null && input.getObject().getPower().getValue() < sourcePermanent.getPower().getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "lesser power";
|
||||
}
|
||||
}
|
129
Mage.Sets/src/mage/cards/h/HeavenlyBlademaster.java
Normal file
129
Mage.Sets/src/mage/cards/h/HeavenlyBlademaster.java
Normal file
|
@ -0,0 +1,129 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.AdditiveDynamicValue;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.AuraAttachedCount;
|
||||
import mage.abilities.dynamicvalue.common.EquipmentAttachedCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
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.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HeavenlyBlademaster extends CardImpl {
|
||||
|
||||
public HeavenlyBlademaster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}");
|
||||
|
||||
this.subtype.add(SubType.ANGEL);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Double strike
|
||||
this.addAbility(DoubleStrikeAbility.getInstance());
|
||||
|
||||
// When Heavenly Blademaster enters the battlefield, you may attach any number of Auras and Equipment you control to it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new HeavenlyBlademasterEffect(), true
|
||||
));
|
||||
|
||||
// Other creatures you control get +1/+1 for each Aura and Equipment attached to Heavenly Blademaster.
|
||||
DynamicValue totalAmount = new AdditiveDynamicValue(
|
||||
new EquipmentAttachedCount(1),
|
||||
new AuraAttachedCount(1)
|
||||
);
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new BoostControlledEffect(
|
||||
totalAmount, totalAmount, Duration.WhileOnBattlefield,
|
||||
StaticFilters.FILTER_PERMANENT_CREATURES, true
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public HeavenlyBlademaster(final HeavenlyBlademaster card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HeavenlyBlademaster copy() {
|
||||
return new HeavenlyBlademaster(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HeavenlyBlademasterEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterControlledPermanent("Aura or Equipment you control");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
new SubtypePredicate(SubType.AURA),
|
||||
new SubtypePredicate(SubType.EQUIPMENT)
|
||||
));
|
||||
}
|
||||
|
||||
public HeavenlyBlademasterEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "you may attach any number "
|
||||
+ "of Auras and Equipment you control to it";
|
||||
}
|
||||
|
||||
public HeavenlyBlademasterEffect(final HeavenlyBlademasterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HeavenlyBlademasterEffect copy() {
|
||||
return new HeavenlyBlademasterEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (permanent == null || player == null) {
|
||||
return false;
|
||||
}
|
||||
Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
|
||||
if (!player.choose(outcome, target, source.getSourceId(), game)) {
|
||||
return false;
|
||||
}
|
||||
target.getTargets().stream().map(
|
||||
attachmentId -> game.getPermanent(attachmentId)
|
||||
).filter(
|
||||
attachment -> attachment != null
|
||||
).forEachOrdered((attachment) -> {
|
||||
attachment.attachTo(permanent.getId(), game);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -79,7 +79,7 @@ class HeraldsHornEffect extends OneShotEffect {
|
|||
|
||||
// If it's a creature card of the chosen type, you may reveal it and put it into your hand.
|
||||
FilterCreatureCard filter = new FilterCreatureCard("creature card of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(source.getSourceId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
String message = "Reveal the top card of your library and put that card into your hand?";
|
||||
if (card != null) {
|
||||
if (filter.match(card, game) && controller.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||
|
|
|
@ -19,7 +19,7 @@ import mage.constants.SubType;
|
|||
*/
|
||||
public final class HollowhengeScavenger extends CardImpl {
|
||||
|
||||
private static final String staticText = "Morbid - When {this} enters the battlefield, if a creature died this turn, you gain 5 life.";
|
||||
private static final String staticText = "<i>Morbid</i> — When {this} enters the battlefield, if a creature died this turn, you gain 5 life.";
|
||||
|
||||
public HollowhengeScavenger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
|
||||
|
@ -28,7 +28,7 @@ public final class HollowhengeScavenger extends CardImpl {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Morbid - When Hollowhenge Scavenger enters the battlefield, if a creature died this turn, you gain 5 life.
|
||||
// <i>Morbid</i> — When Hollowhenge Scavenger enters the battlefield, if a creature died this turn, you gain 5 life.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainLifeEffect(5));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MorbidCondition.instance, staticText));
|
||||
}
|
||||
|
|
|
@ -22,13 +22,13 @@ public final class HungerOfTheHowlpack extends CardImpl {
|
|||
|
||||
|
||||
// Put a +1/+1 counter on target creature.
|
||||
// Morbid - Put three +1/+1 counters on that creature instead if a creature died this turn.
|
||||
// <i>Morbid</i> — Put three +1/+1 counters on that creature instead if a creature died this turn.
|
||||
this.getSpellAbility().addEffect(
|
||||
new ConditionalOneShotEffect(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)),
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||
MorbidCondition.instance,
|
||||
"Put a +1/+1 counter on target creature. Morbid - Put three +1/+1 counters on that creature instead if a creature died this turn"));
|
||||
"Put a +1/+1 counter on target creature. <i>Morbid</i> — Put three +1/+1 counters on that creature instead if a creature died this turn"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
*/
|
||||
public final class IndomitableArchangel extends CardImpl {
|
||||
|
||||
private static final String rule = "Metalcraft - Artifacts you control have shroud as long as you control three or more artifacts.";
|
||||
private static final String rule = "<i>Metalcraft</i> — Artifacts you control have shroud as long as you control three or more artifacts.";
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("Artifacts");
|
||||
|
||||
|
|
118
Mage.Sets/src/mage/cards/i/IsolatedWatchtower.java
Normal file
118
Mage.Sets/src/mage/cards/i/IsolatedWatchtower.java
Normal file
|
@ -0,0 +1,118 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class IsolatedWatchtower extends CardImpl {
|
||||
|
||||
public IsolatedWatchtower(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
// {T}: Add {C}.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {2}, {T}: Scry 1, then you may reveal the top card of your library. If a basic land card is revealed this way, put it onto the battlefield tapped. Activate this ability only if an opponent controls at least two more lands than you.
|
||||
Ability ability = new ConditionalActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new IsolatedWatchtowerEffect(),
|
||||
new GenericManaCost(2),
|
||||
new IsolatedWatchtowerCondition()
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public IsolatedWatchtower(final IsolatedWatchtower card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IsolatedWatchtower copy() {
|
||||
return new IsolatedWatchtower(this);
|
||||
}
|
||||
}
|
||||
|
||||
class IsolatedWatchtowerEffect extends OneShotEffect {
|
||||
|
||||
public IsolatedWatchtowerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "scry 1, then you may reveal the top card "
|
||||
+ "of your library. If a basic land card is revealed this way, "
|
||||
+ "put it onto the battlefield tapped";
|
||||
}
|
||||
|
||||
public IsolatedWatchtowerEffect(final IsolatedWatchtowerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IsolatedWatchtowerEffect copy() {
|
||||
return new IsolatedWatchtowerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
player.scry(1, source, game);
|
||||
if (!player.chooseUse(
|
||||
outcome, "Reveal the top card of your library?", source, game
|
||||
)) {
|
||||
return true;
|
||||
}
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
player.revealCards(source, new CardsImpl(card), game);
|
||||
if (card.isBasic() && card.isLand()) {
|
||||
player.moveCards(
|
||||
card, Zone.BATTLEFIELD, source,
|
||||
game, true, false, true, null
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class IsolatedWatchtowerCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int numLands = game.getBattlefield().countAll(
|
||||
StaticFilters.FILTER_LAND, source.getControllerId(), game
|
||||
);
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
if (numLands < 1 + game.getBattlefield().countAll(
|
||||
StaticFilters.FILTER_LAND, opponentId, game
|
||||
)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "an opponent controls at least two more lands than you";
|
||||
}
|
||||
}
|
|
@ -23,7 +23,7 @@ import mage.filter.StaticFilters;
|
|||
*/
|
||||
public final class JorKadeenThePrevailer extends CardImpl {
|
||||
|
||||
private static final String effectText = "Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts.";
|
||||
private static final String effectText = "<i>Metalcraft</i> — Creatures you control get +3/+0 as long as you control three or more artifacts.";
|
||||
|
||||
public JorKadeenThePrevailer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{W}");
|
||||
|
@ -37,7 +37,7 @@ public final class JorKadeenThePrevailer extends CardImpl {
|
|||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts.
|
||||
// <i>Metalcraft</i> — Creatures you control get +3/+0 as long as you control three or more artifacts.
|
||||
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostControlledEffect(3, 0, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false),
|
||||
MetalcraftCondition.instance, effectText);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
|
74
Mage.Sets/src/mage/cards/k/KestiaTheCultivator.java
Normal file
74
Mage.Sets/src/mage/cards/k/KestiaTheCultivator.java
Normal file
|
@ -0,0 +1,74 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksAllTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.abilities.keyword.BestowAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.filter.predicate.permanent.EnchantedPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class KestiaTheCultivator extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter
|
||||
= new FilterCreaturePermanent("an enchanted creature or enchantment creature you control");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
new EnchantedPredicate(),
|
||||
new CardTypePredicate(CardType.ENCHANTMENT)
|
||||
));
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public KestiaTheCultivator(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{G}{W}{U}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.NYMPH);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Bestow {3}{G}{W}{U}
|
||||
this.addAbility(new BestowAbility(this, "{3}{G}{W}{U}"));
|
||||
|
||||
// Enchanted creature gets +4/+4.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new BoostEnchantedEffect(4, 4, Duration.WhileOnBattlefield)
|
||||
));
|
||||
|
||||
// Whenever an enchanted creature or enchantment creature you control attacks, draw a card.
|
||||
this.addAbility(new AttacksAllTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
false, filter, SetTargetPointer.NONE, false
|
||||
));
|
||||
}
|
||||
|
||||
public KestiaTheCultivator(final KestiaTheCultivator card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KestiaTheCultivator copy() {
|
||||
return new KestiaTheCultivator(this);
|
||||
}
|
||||
}
|
|
@ -42,7 +42,7 @@ public final class KindredBoon extends CardImpl {
|
|||
|
||||
// {1}{W}: Put a divinity counter on target creature you control of the chosen type.
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.DIVINITY.createInstance()), new ManaCostsImpl("{1}{W}"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -27,7 +27,7 @@ public final class KindredDiscovery extends CardImpl {
|
|||
|
||||
// Whenever a creature you control of the chosen type enters the battlefield or attacks, draw a card.
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature you control of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
this.addAbility(new EntersBattlefieldOrAttacksAllTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), filter, false));
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class KuldothaPhoenix extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Metalcraft - {4}: Return Kuldotha Phoenix from your graveyard to the battlefield.
|
||||
// <i>Metalcraft</i> — {4}: Return Kuldotha Phoenix from your graveyard to the battlefield.
|
||||
// Activate this ability only during your upkeep and only if you control three or more artifacts.
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
||||
new ReturnSourceFromGraveyardToBattlefieldEffect(),
|
||||
|
|
112
Mage.Sets/src/mage/cards/l/LordWindgrace.java
Normal file
112
Mage.Sets/src/mage/cards/l/LordWindgrace.java
Normal file
|
@ -0,0 +1,112 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.filter.predicate.other.OwnerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.CatWarriorToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LordWindgrace extends CardImpl {
|
||||
|
||||
private static final FilterLandCard filter = new FilterLandCard("land cards from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new OwnerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public LordWindgrace(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{R}{G}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.WINDGRACE);
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
|
||||
|
||||
// +2: Discard a card, then draw a card. If a land card is discarded this way, draw an additional card.
|
||||
this.addAbility(new LoyaltyAbility(new LordWindgraceEffect(), 2));
|
||||
|
||||
// -3: Return up to two target land cards from your graveyard to the battlefield.
|
||||
Ability ability = new LoyaltyAbility(
|
||||
new ReturnFromGraveyardToBattlefieldTargetEffect(), -3
|
||||
);
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 2, filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
// -11: Destroy up to six target nonland permanents, then create six 2/2 green Cat Warrior creature tokens with forestwalk.
|
||||
ability = new LoyaltyAbility(new DestroyTargetEffect(), -11);
|
||||
ability.addEffect(
|
||||
new CreateTokenEffect(new CatWarriorToken(), 6)
|
||||
.setText(", then create six 2/2 green Cat Warrior "
|
||||
+ "creature tokens with forestwalk")
|
||||
);
|
||||
ability.addTarget(new TargetNonlandPermanent(0, 6, false));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Lord Windgrace can be your commander.
|
||||
this.addAbility(CanBeYourCommanderAbility.getInstance());
|
||||
}
|
||||
|
||||
public LordWindgrace(final LordWindgrace card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LordWindgrace copy() {
|
||||
return new LordWindgrace(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LordWindgraceEffect extends OneShotEffect {
|
||||
|
||||
public LordWindgraceEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "discard a card, then draw a card. "
|
||||
+ "If a land card is discarded this way, draw an additional card";
|
||||
}
|
||||
|
||||
public LordWindgraceEffect(final LordWindgraceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LordWindgraceEffect copy() {
|
||||
return new LordWindgraceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = player.discardOne(false, source, game);
|
||||
if (card == null || !card.isLand()) {
|
||||
player.drawCards(1, game);
|
||||
} else {
|
||||
player.drawCards(2, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
95
Mage.Sets/src/mage/cards/l/LoyalApprentice.java
Normal file
95
Mage.Sets/src/mage/cards/l/LoyalApprentice.java
Normal file
|
@ -0,0 +1,95 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CommanderInPlayCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.ThopterColorlessToken;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LoyalApprentice extends CardImpl {
|
||||
|
||||
public LoyalApprentice(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.ARTIFICER);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Lieutenant — At the beginning of combat on your turn, if you control your commander, create a 1/1 colorless Thopter artifact creature token with flying. That token gains haste until end of turn.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new LoyalApprenticeEffect(),
|
||||
TargetController.YOU, false
|
||||
), CommanderInPlayCondition.instance,
|
||||
"<i>Lieutenant</i> — At the beginning of combat "
|
||||
+ "on your turn, create a 1/1 colorless Thopter "
|
||||
+ "artifact creature token with flying. "
|
||||
+ "That token gains haste until end of turn"
|
||||
));
|
||||
}
|
||||
|
||||
public LoyalApprentice(final LoyalApprentice card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoyalApprentice copy() {
|
||||
return new LoyalApprentice(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LoyalApprenticeEffect extends OneShotEffect {
|
||||
|
||||
public LoyalApprenticeEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
||||
public LoyalApprenticeEffect(final LoyalApprenticeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoyalApprenticeEffect copy() {
|
||||
return new LoyalApprenticeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ThopterColorlessToken());
|
||||
effect.apply(game, source);
|
||||
effect.getLastAddedTokenIds().stream().map((tokenId) -> {
|
||||
ContinuousEffect continuousEffect = new GainAbilityTargetEffect(
|
||||
HasteAbility.getInstance(), Duration.EndOfTurn
|
||||
);
|
||||
continuousEffect.setTargetPointer(new FixedTarget(tokenId, game));
|
||||
return continuousEffect;
|
||||
}).forEachOrdered((continuousEffect) -> {
|
||||
game.addEffect(continuousEffect, source);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
56
Mage.Sets/src/mage/cards/l/LoyalGuardian.java
Normal file
56
Mage.Sets/src/mage/cards/l/LoyalGuardian.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CommanderInPlayCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LoyalGuardian extends CardImpl {
|
||||
|
||||
public LoyalGuardian(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
|
||||
|
||||
this.subtype.add(SubType.RHINO);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Lieutenant — At the beginning of combat on your turn, if you control your commander, put a +1/+1 counter on each creature you control.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new AddCountersAllEffect(
|
||||
CounterType.P1P1.createInstance(),
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE
|
||||
), TargetController.YOU, false
|
||||
), CommanderInPlayCondition.instance,
|
||||
"<i>Lieutenant</i> — At the beginning of combat "
|
||||
+ "on your turn, if you control your commander, "
|
||||
+ "put a +1/+1 counter on each creature you control."
|
||||
));
|
||||
}
|
||||
|
||||
public LoyalGuardian(final LoyalGuardian card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoyalGuardian copy() {
|
||||
return new LoyalGuardian(this);
|
||||
}
|
||||
}
|
52
Mage.Sets/src/mage/cards/l/LoyalSubordinate.java
Normal file
52
Mage.Sets/src/mage/cards/l/LoyalSubordinate.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CommanderInPlayCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LoyalSubordinate extends CardImpl {
|
||||
|
||||
public LoyalSubordinate(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Lieutenant — At the beginning of combat on your turn, if you control your commander, each opponent loses 3 life.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new LoseLifeOpponentsEffect(3),
|
||||
TargetController.YOU, false
|
||||
), CommanderInPlayCondition.instance,
|
||||
"<i>Lieutenant</i> — At the beginning of combat "
|
||||
+ "on your turn, if you control your commander, "
|
||||
+ "each opponent loses 3 life."
|
||||
));
|
||||
}
|
||||
|
||||
public LoyalSubordinate(final LoyalSubordinate card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoyalSubordinate copy() {
|
||||
return new LoyalSubordinate(this);
|
||||
}
|
||||
}
|
66
Mage.Sets/src/mage/cards/l/LoyalUnicorn.java
Normal file
66
Mage.Sets/src/mage/cards/l/LoyalUnicorn.java
Normal file
|
@ -0,0 +1,66 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CommanderInPlayCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.PreventAllDamageToAllEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LoyalUnicorn extends CardImpl {
|
||||
|
||||
public LoyalUnicorn(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
|
||||
this.subtype.add(SubType.UNICORN);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Vigilance
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
|
||||
// Lieutenant — At the beginning of combat on your turn, if you control your commander, prevent all combat damage that would be dealt to creatures you control this turn. Other creatures you control gain vigilance until end of turn.
|
||||
TriggeredAbility ability = new BeginningOfCombatTriggeredAbility(
|
||||
new PreventAllDamageToAllEffect(
|
||||
Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURES,
|
||||
true
|
||||
), TargetController.YOU, false
|
||||
);
|
||||
ability.addEffect(new GainAbilityAllEffect(
|
||||
VigilanceAbility.getInstance(), Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURES, true
|
||||
));
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
ability, CommanderInPlayCondition.instance,
|
||||
"<i>Lieutenant</i> — At the beginning of combat "
|
||||
+ "on your turn, if you control your commander, "
|
||||
+ "prevent all combat damage that would be dealt "
|
||||
+ "to creatures you control this turn. "
|
||||
+ "Other creatures you control gain vigilance until end of turn."
|
||||
));
|
||||
}
|
||||
|
||||
public LoyalUnicorn(final LoyalUnicorn card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoyalUnicorn copy() {
|
||||
return new LoyalUnicorn(this);
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public final class LumengridDrake extends CardImpl {
|
||||
|
||||
private static final String ruleText = "Metalcraft - When {this} enters the battlefield, if you control three or more artifacts, return target creature to its owner's hand.";
|
||||
private static final String ruleText = "<i>Metalcraft</i> — When {this} enters the battlefield, if you control three or more artifacts, return target creature to its owner's hand.";
|
||||
|
||||
public LumengridDrake(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}");
|
||||
|
|
199
Mage.Sets/src/mage/cards/m/MagusOfTheBalance.java
Normal file
199
Mage.Sets/src/mage/cards/m/MagusOfTheBalance.java
Normal file
|
@ -0,0 +1,199 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MagusOfTheBalance extends CardImpl {
|
||||
|
||||
public MagusOfTheBalance(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// {4}{W}, {T}, Sacrifice Magus of the Balance: Each player chooses a number of lands they control equal to the number of lands controlled by the player who controls the fewest, then sacrifices the rest. Players discard cards and sacrifice creatures the same way.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new MagusOfTheBalanceEffect(),
|
||||
new ManaCostsImpl("{4}{W}")
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public MagusOfTheBalance(final MagusOfTheBalance card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagusOfTheBalance copy() {
|
||||
return new MagusOfTheBalance(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MagusOfTheBalanceEffect extends OneShotEffect {
|
||||
|
||||
MagusOfTheBalanceEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
staticText = "each player chooses a number of lands they control "
|
||||
+ "equal to the number of lands controlled by the player "
|
||||
+ "who controls the fewest, then sacrifices the rest. "
|
||||
+ "Players discard cards and sacrifice creatures the same way";
|
||||
}
|
||||
|
||||
MagusOfTheBalanceEffect(final MagusOfTheBalanceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagusOfTheBalanceEffect copy() {
|
||||
return new MagusOfTheBalanceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
//Lands
|
||||
int minLand = Integer.MAX_VALUE;
|
||||
Cards landsToSacrifice = new CardsImpl();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int count = game.getBattlefield().countAll(new FilterControlledLandPermanent(), player.getId(), game);
|
||||
if (count < minLand) {
|
||||
minLand = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(minLand, minLand, new FilterControlledLandPermanent("lands to keep"), true);
|
||||
if (target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game)) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledLandPermanent(), player.getId(), source.getSourceId(), game)) {
|
||||
if (permanent != null && !target.getTargets().contains(permanent.getId())) {
|
||||
landsToSacrifice.add(permanent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID cardId : landsToSacrifice) {
|
||||
Permanent permanent = game.getPermanent(cardId);
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
|
||||
//Creatures
|
||||
int minCreature = Integer.MAX_VALUE;
|
||||
Cards creaturesToSacrifice = new CardsImpl();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int count = game.getBattlefield().countAll(new FilterControlledCreaturePermanent(), player.getId(), game);
|
||||
if (count < minCreature) {
|
||||
minCreature = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(minCreature, minCreature, new FilterControlledCreaturePermanent("creatures to keep"), true);
|
||||
if (target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game)) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), player.getId(), source.getSourceId(), game)) {
|
||||
if (permanent != null && !target.getTargets().contains(permanent.getId())) {
|
||||
creaturesToSacrifice.add(permanent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID cardId : creaturesToSacrifice) {
|
||||
Permanent permanent = game.getPermanent(cardId);
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
|
||||
//Cards in hand
|
||||
int minCard = Integer.MAX_VALUE;
|
||||
Map<UUID, Cards> cardsToDiscard = new HashMap<>(2);
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int count = player.getHand().size();
|
||||
if (count < minCard) {
|
||||
minCard = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
TargetCardInHand target = new TargetCardInHand(minCard, new FilterCard("cards to keep"));
|
||||
if (target.choose(Outcome.Discard, player.getId(), source.getSourceId(), game)) {
|
||||
for (Card card : player.getHand().getCards(game)) {
|
||||
if (card != null && !target.getTargets().contains(card.getId())) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
cardsToDiscard.put(playerId, cards);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null && cardsToDiscard.get(playerId) != null) {
|
||||
for (UUID cardId : cardsToDiscard.get(playerId)) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
player.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ public final class MaliciousAffliction extends CardImpl {
|
|||
public MaliciousAffliction(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{B}");
|
||||
|
||||
// Morbid - When you cast Malicious Affliction, if a creature died this turn, you may copy Malicious Affliction and may choose a new target for the copy.
|
||||
// <i>Morbid</i> — When you cast Malicious Affliction, if a creature died this turn, you may copy Malicious Affliction and may choose a new target for the copy.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new CastSourceTriggeredAbility(new CopySourceSpellEffect(), true),
|
||||
new LockedInCondition(MorbidCondition.instance),
|
||||
|
|
|
@ -4,6 +4,7 @@ package mage.cards.m;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.continuous.AddChosenSubtypeEffect;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
|
@ -36,6 +37,7 @@ public final class MetallicMimic extends CardImpl {
|
|||
// Metallic Mimic is the chosen type in addition to its other types.
|
||||
ability.addEffect(new EnterAttributeAddChosenSubtypeEffect());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AddChosenSubtypeEffect()));
|
||||
|
||||
// Each other creature you control of the chosen type enters the battlefield with an additional +1/+1 counter on it.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MetallicMimicReplacementEffect()));
|
||||
|
|
|
@ -18,7 +18,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public final class MirranMettle extends CardImpl {
|
||||
|
||||
private static final String effectText = "Metalcraft - That creature gets +4/+4 until end of turn instead if you control three or more artifacts.";
|
||||
private static final String effectText = "<i>Metalcraft</i> — That creature gets +4/+4 until end of turn instead if you control three or more artifacts.";
|
||||
|
||||
public MirranMettle(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");
|
||||
|
|
|
@ -38,7 +38,7 @@ public final class MirrorOfTheForebears extends CardImpl {
|
|||
|
||||
// 1: Until end of turn, Mirror of the Forebears becomes a copy of target creature you control of the chosen type, except it's an artifact in addition to its other types.
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MirrorOfTheForebearsCopyEffect(), new ManaCostsImpl("{1}"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -29,7 +29,7 @@ public final class MoltenPsyche extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
|
||||
|
||||
// Each player shuffles the cards from their hand into their library, then draws that many cards.
|
||||
// Metalcraft - If you control three or more artifacts, Molten Psyche deals damage to each opponent equal to the number of cards that player has drawn this turn.
|
||||
// <i>Metalcraft</i> — If you control three or more artifacts, Molten Psyche deals damage to each opponent equal to the number of cards that player has drawn this turn.
|
||||
this.getSpellAbility().addEffect(new MoltenPsycheEffect());
|
||||
this.getSpellAbility().addWatcher(new MoltenPsycheWatcher());
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public final class MorkrutBanshee extends CardImpl {
|
||||
|
||||
private static final String staticText = "Morbid - When {this} enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn.";
|
||||
private static final String staticText = "<i>Morbid</i> — When {this} enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn.";
|
||||
|
||||
public MorkrutBanshee(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
|
||||
|
@ -30,7 +30,7 @@ public final class MorkrutBanshee extends CardImpl {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Morbid - When Morkut Banshee enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn.
|
||||
// <i>Morbid</i> — When Morkut Banshee enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn.
|
||||
TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(-4, -4, Duration.EndOfTurn));
|
||||
TriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, MorbidCondition.instance, staticText);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
|
113
Mage.Sets/src/mage/cards/m/MythUnbound.java
Normal file
113
Mage.Sets/src/mage/cards/m/MythUnbound.java
Normal file
|
@ -0,0 +1,113 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.ZoneChangeAllTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.CostModificationType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.other.OwnerPredicate;
|
||||
import mage.filter.predicate.permanent.CommanderPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MythUnbound extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent();
|
||||
|
||||
static {
|
||||
filter.add(new CommanderPredicate());
|
||||
filter.add(new OwnerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public MythUnbound(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||
|
||||
// Your commander costs {1} less to cast for each time it's been cast from the command zone this game.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new MythUnboundCostReductionEffect()
|
||||
));
|
||||
|
||||
// Whenever your commander is put into the command zone from anywhere, draw a card.
|
||||
this.addAbility(new ZoneChangeAllTriggeredAbility(
|
||||
Zone.BATTLEFIELD, Zone.ALL, Zone.COMMAND,
|
||||
new DrawCardSourceControllerEffect(1), filter,
|
||||
"Whenever your commander is put into "
|
||||
+ "the command zone from anywhere, ", false
|
||||
));
|
||||
}
|
||||
|
||||
public MythUnbound(final MythUnbound card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MythUnbound copy() {
|
||||
return new MythUnbound(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MythUnboundCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
MythUnboundCostReductionEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "your commander costs {1} less to cast for each time "
|
||||
+ "it's been cast from the command zone this game";
|
||||
}
|
||||
|
||||
MythUnboundCostReductionEffect(MythUnboundCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
Ability spellAbility = (SpellAbility) abilityToModify;
|
||||
if (spellAbility != null) {
|
||||
Integer amount = (Integer) game.getState().getValue(abilityToModify.getControllerId() + "_castCount");
|
||||
if (amount != null && amount > 0) {
|
||||
CardUtil.reduceCost(spellAbility, amount);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
if (abilityToModify instanceof SpellAbility) {
|
||||
if (abilityToModify.isControlledBy(source.getControllerId())) {
|
||||
Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId());
|
||||
if (spell != null) {
|
||||
return player.getCommandersIds().contains(spell.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MythUnboundCostReductionEffect copy() {
|
||||
return new MythUnboundCostReductionEffect(this);
|
||||
}
|
||||
}
|
|
@ -1,20 +1,18 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ControlledCreaturesDealCombatDamagePlayerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect;
|
||||
import mage.abilities.effects.common.UntapAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -26,7 +24,11 @@ public final class NaturesWill extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
|
||||
|
||||
// Whenever one or more creatures you control deal combat damage to a player, tap all lands that player controls and untap all lands you control.
|
||||
this.addAbility(new ControlledCreaturesDealCombatDamagePlayerTriggeredAbility(new NaturesWillEffect()));
|
||||
Effect tapAllEffect = new TapAllTargetPlayerControlsEffect(new FilterLandPermanent());
|
||||
tapAllEffect.setText("tap all lands that player controls");
|
||||
Ability ability = new ControlledCreaturesDealCombatDamagePlayerTriggeredAbility(Zone.BATTLEFIELD, tapAllEffect, true);
|
||||
ability.addEffect(new UntapAllEffect(new FilterControlledLandPermanent()));
|
||||
addAbility(ability);
|
||||
}
|
||||
|
||||
public NaturesWill(final NaturesWill card) {
|
||||
|
@ -38,37 +40,3 @@ public final class NaturesWill extends CardImpl {
|
|||
return new NaturesWill(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NaturesWillEffect extends OneShotEffect {
|
||||
|
||||
public NaturesWillEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "tap all lands that player controls and untap all lands you control";
|
||||
}
|
||||
|
||||
public NaturesWillEffect(final NaturesWillEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NaturesWillEffect copy() {
|
||||
return new NaturesWillEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<UUID> damagedPlayers = (HashSet<UUID>) this.getValue("damagedPlayers");
|
||||
if (damagedPlayers != null) {
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent land : lands) {
|
||||
if (damagedPlayers.contains(land.getControllerId())) {
|
||||
land.tap(game);
|
||||
} else if (land.isControlledBy(source.getControllerId())) {
|
||||
land.untap(game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
44
Mage.Sets/src/mage/cards/n/NestingDragon.java
Normal file
44
Mage.Sets/src/mage/cards/n/NestingDragon.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.permanent.token.NestingDragonToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NestingDragon extends CardImpl {
|
||||
|
||||
public NestingDragon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Landfall — Whenever a land enters the battlefield under your control, create a 0/2 red Dragon Egg creature token with defender and "When this creature dies, create a 2/2 red Dragon creature token with flying and '{R}: This creature gets +1/+0 until end of turn.'"
|
||||
this.addAbility(new LandfallAbility(
|
||||
new CreateTokenEffect(new NestingDragonToken()), false
|
||||
));
|
||||
}
|
||||
|
||||
public NestingDragon(final NestingDragon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NestingDragon copy() {
|
||||
return new NestingDragon(this);
|
||||
}
|
||||
}
|
49
Mage.Sets/src/mage/cards/n/NightIncarnate.java
Normal file
49
Mage.Sets/src/mage/cards/n/NightIncarnate.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.EvokeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NightIncarnate extends CardImpl {
|
||||
|
||||
public NightIncarnate(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
||||
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Deathtouch
|
||||
this.addAbility(DeathtouchAbility.getInstance());
|
||||
|
||||
// When Night Incarnate leaves the battlefield, all creatures get -3/-3 until end of turn.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(
|
||||
new BoostAllEffect(-3, -3, Duration.EndOfTurn), false
|
||||
));
|
||||
|
||||
// Evoke {3}{B}
|
||||
this.addAbility(new EvokeAbility(this, "{3}{B}"));
|
||||
|
||||
}
|
||||
|
||||
public NightIncarnate(final NightIncarnate card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NightIncarnate copy() {
|
||||
return new NightIncarnate(this);
|
||||
}
|
||||
}
|
75
Mage.Sets/src/mage/cards/n/NyleasColossus.java
Normal file
75
Mage.Sets/src/mage/cards/n/NyleasColossus.java
Normal file
|
@ -0,0 +1,75 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.abilityword.ConstellationAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NyleasColossus extends CardImpl {
|
||||
|
||||
public NyleasColossus(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{6}{G}");
|
||||
|
||||
this.subtype.add(SubType.GIANT);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Constellation — Whenever Nylea's Colossus or another enchantment enters the battlefield under your control, double target creature's power and toughness until end of turn.
|
||||
Ability ability = new ConstellationAbility(new NyleasColossusEffect(), false);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public NyleasColossus(final NyleasColossus card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NyleasColossus copy() {
|
||||
return new NyleasColossus(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NyleasColossusEffect extends OneShotEffect {
|
||||
|
||||
public NyleasColossusEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "double target creature's power and toughness until end of turn";
|
||||
}
|
||||
|
||||
public NyleasColossusEffect(final NyleasColossusEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NyleasColossusEffect copy() {
|
||||
return new NyleasColossusEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int power = permanent.getPower().getValue();
|
||||
int toughness = permanent.getToughness().getValue();
|
||||
game.addEffect(new BoostTargetEffect(power, toughness, Duration.EndOfTurn), source);
|
||||
return true;
|
||||
}
|
||||
}
|
76
Mage.Sets/src/mage/cards/o/OctopusUmbra.java
Normal file
76
Mage.Sets/src/mage/cards/o/OctopusUmbra.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
package mage.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.TotemArmorAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class OctopusUmbra extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 8 or less");
|
||||
|
||||
static {
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 9));
|
||||
}
|
||||
|
||||
public OctopusUmbra(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature has base power and toughness 8/8 and has "Whenever this creature attacks, you may tap target creature with power 8 or less."
|
||||
Ability abilityToAdd = new AttacksTriggeredAbility(new TapTargetEffect(), true);
|
||||
abilityToAdd.addTarget(new TargetCreaturePermanent(filter));
|
||||
ability = new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new SetPowerToughnessEnchantedEffect(8, 8)
|
||||
);
|
||||
ability.addEffect(new GainAbilityAttachedEffect(
|
||||
abilityToAdd, AttachmentType.AURA
|
||||
).setText("and has \"Whenever this creature attacks, "
|
||||
+ "you may tap target creature with power 8 or less.\""));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Totem armor
|
||||
this.addAbility(new TotemArmorAbility());
|
||||
|
||||
}
|
||||
|
||||
public OctopusUmbra(final OctopusUmbra card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OctopusUmbra copy() {
|
||||
return new OctopusUmbra(this);
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ public final class PredatorsHowl extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}");
|
||||
|
||||
// Create a 2/2 green Wolf creature token.
|
||||
// Morbid - Create three 2/2 green Wolf creature tokens instead if a creature died this turn.
|
||||
// <i>Morbid</i> — Create three 2/2 green Wolf creature tokens instead if a creature died this turn.
|
||||
Effect effect = new ConditionalOneShotEffect(
|
||||
new CreateTokenEffect(new WolfToken(), 3),
|
||||
new CreateTokenEffect(new WolfToken(), 1),
|
||||
|
|
146
Mage.Sets/src/mage/cards/p/PrimordialMist.java
Normal file
146
Mage.Sets/src/mage/cards/p/PrimordialMist.java
Normal file
|
@ -0,0 +1,146 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.keyword.ManifestEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.other.FaceDownPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class PrimordialMist extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("face down permanent");
|
||||
|
||||
static {
|
||||
filter.add(new FaceDownPredicate());
|
||||
}
|
||||
|
||||
public PrimordialMist(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}");
|
||||
|
||||
// At the beginning of your end step, you may manifest the top card of your library.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new ManifestEffect(1), TargetController.YOU, true));
|
||||
|
||||
// Exile a face-down permanent you control face-up: You may play that card this turn
|
||||
TargetPermanent target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new PrimordialMistCastFromExileEffect(),
|
||||
new PrimordialMistCost(target));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public PrimordialMist(final PrimordialMist card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimordialMist copy() {
|
||||
return new PrimordialMist(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PrimordialMistCost extends CostImpl {
|
||||
|
||||
TargetPermanent target;
|
||||
|
||||
public PrimordialMistCost(TargetPermanent target) {
|
||||
this.target = target;
|
||||
this.text = "Exile a face-down permanent you control face-up";
|
||||
}
|
||||
|
||||
public PrimordialMistCost(final PrimordialMistCost cost) {
|
||||
super(cost);
|
||||
this.target = cost.target.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimordialMistCost copy() {
|
||||
return new PrimordialMistCost(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
|
||||
return target.canChoose(controllerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
Player controller = game.getPlayer(controllerId);
|
||||
if (controller != null) {
|
||||
if (target.choose(Outcome.Exile, controllerId, sourceId, game)) {
|
||||
Card card = game.getCard(sourceId);
|
||||
if (card != null) {
|
||||
Permanent sourcePermanent = game.getPermanent(sourceId);
|
||||
if (sourcePermanent != null) {
|
||||
Permanent targetPermanent = game.getPermanent(target.getFirstTarget());
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetPermanent != null && targetCard != null) {
|
||||
String exileName = sourcePermanent.getIdName() + " <this card may be played the turn it was exiled>";
|
||||
controller.moveCardsToExile(targetPermanent, ability, game, true, sourceId, exileName);
|
||||
targetPermanent.setFaceDown(false, game);
|
||||
ContinuousEffect effect = new PrimordialMistCastFromExileEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCard.getId(), targetCard.getZoneChangeCounter(game)));
|
||||
game.addEffect(effect, ability);
|
||||
this.setPaid();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setPaid();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class PrimordialMistCastFromExileEffect extends AsThoughEffectImpl {
|
||||
|
||||
public PrimordialMistCastFromExileEffect() {
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit);
|
||||
staticText = "Exile a face-down permanent you control face-up. You may play the card from exile";
|
||||
}
|
||||
|
||||
public PrimordialMistCastFromExileEffect(final PrimordialMistCastFromExileEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimordialMistCastFromExileEffect copy() {
|
||||
return new PrimordialMistCastFromExileEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& (game.getCard(getTargetPointer().getFirst(game, source)) != null);
|
||||
}
|
||||
}
|
|
@ -39,11 +39,11 @@ public final class PuresteelPaladin extends CardImpl {
|
|||
|
||||
// Whenever an Equipment enters the battlefield under your control, you may draw a card.
|
||||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), filter, true));
|
||||
// Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts
|
||||
// <i>Metalcraft</i> — Equipment you control have equip {0} as long as you control three or more artifacts
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
|
||||
new GainAbilityControlledEffect(new EquipAbility(Outcome.AddAbility, new GenericManaCost(0)), Duration.WhileOnBattlefield, filter),
|
||||
MetalcraftCondition.instance,
|
||||
"Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts")));
|
||||
"<i>Metalcraft</i> — Equipment you control have equip {0} as long as you control three or more artifacts")));
|
||||
}
|
||||
|
||||
public PuresteelPaladin(final PuresteelPaladin card) {
|
||||
|
|
141
Mage.Sets/src/mage/cards/r/RavenousSlime.java
Normal file
141
Mage.Sets/src/mage/cards/r/RavenousSlime.java
Normal file
|
@ -0,0 +1,141 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RavenousSlime extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter
|
||||
= new FilterCreaturePermanent("creatures with power 2 or less");
|
||||
|
||||
static {
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3));
|
||||
}
|
||||
|
||||
public RavenousSlime(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
|
||||
this.subtype.add(SubType.OOZE);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Ravenous Slime can't be blocked by creatures with power 2 or less.
|
||||
this.addAbility(new SimpleEvasionAbility(
|
||||
new CantBeBlockedByCreaturesSourceEffect(
|
||||
filter, Duration.WhileOnBattlefield
|
||||
)
|
||||
));
|
||||
|
||||
// If a creature an opponent controls would die, instead exile it and put a number of +1/+1 counters equal to that creature's power on Ravenous Slime.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new RavenousSlimeEffect()
|
||||
));
|
||||
}
|
||||
|
||||
public RavenousSlime(final RavenousSlime card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RavenousSlime copy() {
|
||||
return new RavenousSlime(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RavenousSlimeEffect extends ReplacementEffectImpl {
|
||||
|
||||
public RavenousSlimeEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "If a creature an opponent controls would die, "
|
||||
+ "instead exile it and put a number of +1/+1 counters "
|
||||
+ "equal to that creature's power on {this}";
|
||||
}
|
||||
|
||||
public RavenousSlimeEffect(final RavenousSlimeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RavenousSlimeEffect copy() {
|
||||
return new RavenousSlimeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourceCreature = game.getPermanent(source.getSourceId());
|
||||
if (controller == null || sourceCreature == null) {
|
||||
return false;
|
||||
}
|
||||
if (((ZoneChangeEvent) event).getFromZone() != Zone.BATTLEFIELD) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int power = permanent.getPower().getValue();
|
||||
controller.moveCards(permanent, Zone.EXILED, source, game);
|
||||
return new AddCountersSourceEffect(
|
||||
CounterType.P1P1.createInstance(power)
|
||||
).apply(game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getToZone() != Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent == null
|
||||
|| !game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield
|
||||
if (zEvent.getTarget().isCreature()) {
|
||||
return true;
|
||||
}
|
||||
} else if (permanent.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@ public final class RazorfieldRhino extends CardImpl {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
ContinuousEffect effect1 = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect1, MetalcraftCondition.instance, "Metalcraft - Razorfield Rhino gets +2/+2 as long as you control three or more artifacts")));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect1, MetalcraftCondition.instance, "<i>Metalcraft</i> — Razorfield Rhino gets +2/+2 as long as you control three or more artifacts")));
|
||||
}
|
||||
|
||||
public RazorfieldRhino (final RazorfieldRhino card) {
|
||||
|
|
111
Mage.Sets/src/mage/cards/r/RealityScramble.java
Normal file
111
Mage.Sets/src/mage/cards/r/RealityScramble.java
Normal file
|
@ -0,0 +1,111 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.RetraceAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.other.OwnerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RealityScramble extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterPermanent("permanent you own");
|
||||
|
||||
static {
|
||||
filter.add(new OwnerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public RealityScramble(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
|
||||
|
||||
// Put target permanent you own on the bottom of your library. Reveal cards from the top of your library until you reveal a card that shares a card type with that permanent. Put that card onto the battlefield and the rest on the bottom of your library in a random order.
|
||||
this.getSpellAbility().addEffect(new RealityScrambleEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
|
||||
// Retrace
|
||||
this.addAbility(new RetraceAbility(this));
|
||||
}
|
||||
|
||||
public RealityScramble(final RealityScramble card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealityScramble copy() {
|
||||
return new RealityScramble(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RealityScrambleEffect extends OneShotEffect {
|
||||
|
||||
public RealityScrambleEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Put target permanent you own "
|
||||
+ "on the bottom of your library. Reveal cards from "
|
||||
+ "the top of your library until you reveal a card "
|
||||
+ "that shares a card type with that permanent. "
|
||||
+ "Put that card onto the battlefield and the rest "
|
||||
+ "on the bottom of your library in a random order.";
|
||||
}
|
||||
|
||||
public RealityScrambleEffect(final RealityScrambleEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealityScrambleEffect copy() {
|
||||
return new RealityScrambleEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (permanent == null || controller == null) {
|
||||
return false;
|
||||
}
|
||||
Set<CardType> types = EnumSet.noneOf(CardType.class);
|
||||
types.addAll(permanent.getCardType());
|
||||
controller.putCardsOnBottomOfLibrary(
|
||||
new CardsImpl(permanent), game, source, false
|
||||
);
|
||||
Cards toReveal = new CardsImpl();
|
||||
Card cardToPlay = null;
|
||||
for (Card card : controller.getLibrary().getCards(game)) {
|
||||
toReveal.add(card);
|
||||
for (CardType type : types) {
|
||||
if (card.getCardType().contains(type)) {
|
||||
cardToPlay = card;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
controller.revealCards(source, toReveal, game);
|
||||
if (cardToPlay != null) {
|
||||
controller.moveCards(cardToPlay, Zone.BATTLEFIELD, source, game);
|
||||
toReveal.remove(cardToPlay);
|
||||
}
|
||||
controller.putCardsOnBottomOfLibrary(toReveal, game, source, false);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -87,6 +87,6 @@ class ReaperFromTheAbyssAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Morbid - At the beginning of each end step, if a creature died this turn, destroy target non-demon creature.";
|
||||
return "<i>Morbid</i> — At the beginning of each end step, if a creature died this turn, destroy target non-demon creature.";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public final class RustedRelic extends CardImpl {
|
|||
new ConditionalContinuousEffect(
|
||||
new BecomesCreatureSourceEffect(new RustedRelicToken(), "artifact", Duration.WhileOnBattlefield),
|
||||
MetalcraftCondition.instance,
|
||||
"Metalcraft - {this} is a 5/5 Golem artifact creature as long as you control three or more artifacts")));
|
||||
"<i>Metalcraft</i> — {this} is a 5/5 Golem artifact creature as long as you control three or more artifacts")));
|
||||
}
|
||||
|
||||
public RustedRelic (final RustedRelic card) {
|
||||
|
|
162
Mage.Sets/src/mage/cards/s/SaheeliTheGifted.java
Normal file
162
Mage.Sets/src/mage/cards/s/SaheeliTheGifted.java
Normal file
|
@ -0,0 +1,162 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.CostModificationType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.ServoToken;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.common.CastSpellLastTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SaheeliTheGifted extends CardImpl {
|
||||
|
||||
public SaheeliTheGifted(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{R}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.SAHEELI);
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Create a 1/1 colorless Servo artifact creature token.
|
||||
this.addAbility(new LoyaltyAbility(
|
||||
new CreateTokenEffect(new ServoToken()), 1
|
||||
));
|
||||
|
||||
// +1: The next spell you cast this turn costs {1} less to cast for each artifact you control as you cast it.
|
||||
this.addAbility(new LoyaltyAbility(
|
||||
new SaheeliTheGiftedCostReductionEffect(), 1
|
||||
));
|
||||
|
||||
// -7: For each artifact you control, create a token that's a copy of it. Those tokens gain haste. Exile those tokens at the beginning of the next end step.
|
||||
this.addAbility(new LoyaltyAbility(
|
||||
new SaheeliTheGiftedTokenEffect(), -7
|
||||
));
|
||||
|
||||
// Saheeli, the Gifted can be your commander.
|
||||
this.addAbility(CanBeYourCommanderAbility.getInstance());
|
||||
}
|
||||
|
||||
public SaheeliTheGifted(final SaheeliTheGifted card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaheeliTheGifted copy() {
|
||||
return new SaheeliTheGifted(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SaheeliTheGiftedCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
private int spellsCast;
|
||||
|
||||
public SaheeliTheGiftedCostReductionEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "the next spell you cast this turn costs {1} less to cast "
|
||||
+ "for each artifact you control as you cast it";
|
||||
}
|
||||
|
||||
protected SaheeliTheGiftedCostReductionEffect(final SaheeliTheGiftedCostReductionEffect effect) {
|
||||
super(effect);
|
||||
this.spellsCast = effect.spellsCast;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
|
||||
if (watcher != null) {
|
||||
spellsCast = watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
int artifactCount = game.getBattlefield().getAllActivePermanents(
|
||||
StaticFilters.FILTER_PERMANENT_ARTIFACT_AN,
|
||||
source.getControllerId(), game
|
||||
).size();
|
||||
CardUtil.reduceCost(abilityToModify, artifactCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
|
||||
if (watcher != null) {
|
||||
if (watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) > spellsCast) {
|
||||
discard(); // only one use
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (abilityToModify instanceof SpellAbility) {
|
||||
return abilityToModify.isControlledBy(source.getControllerId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaheeliTheGiftedCostReductionEffect copy() {
|
||||
return new SaheeliTheGiftedCostReductionEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SaheeliTheGiftedTokenEffect extends OneShotEffect {
|
||||
|
||||
public SaheeliTheGiftedTokenEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "for each artifact you control, "
|
||||
+ "create a token that's a copy of it. "
|
||||
+ "Those tokens gain haste. "
|
||||
+ "Exile those tokens at the beginning of the next end step.";
|
||||
}
|
||||
|
||||
public SaheeliTheGiftedTokenEffect(final SaheeliTheGiftedTokenEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaheeliTheGiftedTokenEffect copy() {
|
||||
return new SaheeliTheGiftedTokenEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(
|
||||
StaticFilters.FILTER_PERMANENT_ARTIFACT_AN,
|
||||
source.getControllerId(), game
|
||||
)) {
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect
|
||||
= new CreateTokenCopyTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
effect.setHasHaste(true);
|
||||
effect.apply(game, source);
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ import mage.constants.SubType;
|
|||
*/
|
||||
public final class ScreechingSilcaw extends CardImpl {
|
||||
|
||||
private static final String text = "Metalcraft - Whenever Screeching Silcaw deals combat damage to a player, if you control three or more artifacts, that player puts the top four cards of their library into their graveyard.";
|
||||
private static final String text = "<i>Metalcraft</i> — Whenever Screeching Silcaw deals combat damage to a player, if you control three or more artifacts, that player puts the top four cards of their library into their graveyard.";
|
||||
|
||||
public ScreechingSilcaw(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
|
||||
|
@ -31,7 +31,7 @@ public final class ScreechingSilcaw extends CardImpl {
|
|||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
//"Metalcraft - Whenever Screeching Silcaw deals combat damage to a player, if you control three or more artifacts, that player puts the top four cards of their library into their graveyard.
|
||||
//"<i>Metalcraft</i> — Whenever Screeching Silcaw deals combat damage to a player, if you control three or more artifacts, that player puts the top four cards of their library into their graveyard.
|
||||
TriggeredAbility conditional = new ConditionalInterveningIfTriggeredAbility(
|
||||
new DealsCombatDamageToAPlayerTriggeredAbility(new PutLibraryIntoGraveTargetEffect(4), false, true),
|
||||
MetalcraftCondition.instance, text);
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class SkirsdagHighPriest extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Morbid - {tap}, Tap two untapped creatures you control: Create a 5/5 black Demon creature token with flying. Activate this ability only if a creature died this turn.
|
||||
// <i>Morbid</i> — {tap}, Tap two untapped creatures you control: Create a 5/5 black Demon creature token with flying. Activate this ability only if a creature died this turn.
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DemonToken()),
|
||||
new TapSourceCost(), MorbidCondition.instance);
|
||||
ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, false)));
|
||||
|
|
88
Mage.Sets/src/mage/cards/s/SkullStorm.java
Normal file
88
Mage.Sets/src/mage/cards/s/SkullStorm.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.keyword.CommanderStormAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SkullStorm extends CardImpl {
|
||||
|
||||
public SkullStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{B}{B}");
|
||||
|
||||
// When you cast this spell, copy it for each time you've cast your commander from the command zone this game.
|
||||
this.addAbility(new CommanderStormAbility());
|
||||
|
||||
// Each opponent sacrifices a creature. Each opponent who can't loses half their life, rounded up.
|
||||
this.getSpellAbility().addEffect(new SkullStormEffect());
|
||||
}
|
||||
|
||||
public SkullStorm(final SkullStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkullStorm copy() {
|
||||
return new SkullStorm(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SkullStormEffect extends OneShotEffect {
|
||||
|
||||
public SkullStormEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Each opponent sacrifices a creature. "
|
||||
+ "Each opponent who can't loses half their life, rounded up.";
|
||||
}
|
||||
|
||||
public SkullStormEffect(final SkullStormEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkullStormEffect copy() {
|
||||
return new SkullStormEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
game.getOpponents(source.getControllerId()).forEach((playerId) -> {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (!(player == null)) {
|
||||
FilterPermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new ControllerIdPredicate(playerId));
|
||||
if (game.getBattlefield().getActivePermanents(
|
||||
filter, source.getControllerId(), game
|
||||
).isEmpty()) {
|
||||
int lifeToLose = (int) Math.ceil(player.getLife() / 2);
|
||||
player.loseLife(lifeToLose, game, false);
|
||||
} else {
|
||||
Effect effect = new SacrificeEffect(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE, 1, null
|
||||
);
|
||||
effect.setTargetPointer(new FixedTarget(playerId, game));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//doot doot
|
|
@ -23,7 +23,7 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public final class SnapsailGlider extends CardImpl {
|
||||
|
||||
protected static String rule = "Metalcraft - Snapsail Glider has flying as long as you control three or more artifacts";
|
||||
protected static String rule = "<i>Metalcraft</i> — Snapsail Glider has flying as long as you control three or more artifacts";
|
||||
|
||||
public SnapsailGlider (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}");
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class SomberwaldSpider extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
// Morbid - Somberwald Spider enters the battlefield with two +1/+1 counters on it if a creature died this turn.
|
||||
// <i>Morbid</i> — Somberwald Spider enters the battlefield with two +1/+1 counters on it if a creature died this turn.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), MorbidCondition.instance, ""),
|
||||
"with two +1/+1 counters on it if a creature died this turn"));
|
||||
|
|
162
Mage.Sets/src/mage/cards/s/SowerOfDiscord.java
Normal file
162
Mage.Sets/src/mage/cards/s/SowerOfDiscord.java
Normal file
|
@ -0,0 +1,162 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SowerOfDiscord extends CardImpl {
|
||||
|
||||
public SowerOfDiscord(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.DEMON);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// As Sower of Discord enters the battlefield, choose two players.
|
||||
this.addAbility(new AsEntersBattlefieldAbility(
|
||||
new SowerOfDiscordEntersBattlefieldEffect()
|
||||
));
|
||||
|
||||
// Whenever damage is dealt to one of the chosen players, the other chosen player also loses that much life.
|
||||
this.addAbility(new SowerOfDiscordTriggeredAbility());
|
||||
}
|
||||
|
||||
public SowerOfDiscord(final SowerOfDiscord card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SowerOfDiscord copy() {
|
||||
return new SowerOfDiscord(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SowerOfDiscordEntersBattlefieldEffect extends OneShotEffect {
|
||||
|
||||
public SowerOfDiscordEntersBattlefieldEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "choose two players";
|
||||
}
|
||||
|
||||
public SowerOfDiscordEntersBattlefieldEffect(final SowerOfDiscordEntersBattlefieldEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanentEntering(source.getSourceId());
|
||||
if (controller == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
TargetPlayer target = new TargetPlayer(2, 2, true);
|
||||
controller.chooseTarget(outcome, target, source, game);
|
||||
Player player1 = game.getPlayer(target.getFirstTarget());
|
||||
if (target.getTargets().size() <= 1) {
|
||||
return false;
|
||||
}
|
||||
Player player2 = game.getPlayer(target.getTargets().get(1));
|
||||
if (player1 == null || player2 == null) {
|
||||
return false;
|
||||
}
|
||||
game.getState().setValue(source.getSourceId() + "_player1", player1);
|
||||
game.getState().setValue(source.getSourceId() + "_player2", player2);
|
||||
game.informPlayers(permanent.getLogName() + ": "
|
||||
+ controller.getLogName() + " has chosen "
|
||||
+ player1.getLogName() + " and " + player2.getLogName()
|
||||
);
|
||||
permanent.addInfo(
|
||||
"chosen players",
|
||||
"<font color = 'blue'>Chosen players: "
|
||||
+ player1.getName() + ", "
|
||||
+ player2.getName() + "</font>", game
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SowerOfDiscordEntersBattlefieldEffect copy() {
|
||||
return new SowerOfDiscordEntersBattlefieldEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SowerOfDiscordTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public SowerOfDiscordTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
public SowerOfDiscordTriggeredAbility(final SowerOfDiscordTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SowerOfDiscordTriggeredAbility copy() {
|
||||
return new SowerOfDiscordTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
int damage = event.getAmount();
|
||||
Player player1 = (Player) game.getState().getValue(
|
||||
this.getSourceId() + "_player1"
|
||||
);
|
||||
Player player2 = (Player) game.getState().getValue(
|
||||
this.getSourceId() + "_player2"
|
||||
);
|
||||
if (player1 == null || player2 == null || damage == 0) {
|
||||
return false;
|
||||
}
|
||||
Effect effect = new LoseLifeTargetEffect(damage);
|
||||
if (event.getTargetId().equals(player1.getId())) {
|
||||
this.getEffects().clear();
|
||||
effect.setTargetPointer(new FixedTarget(player2.getId()));
|
||||
this.addEffect(effect);
|
||||
return true;
|
||||
} else if (event.getTargetId().equals(player2.getId())) {
|
||||
this.getEffects().clear();
|
||||
effect.setTargetPointer(new FixedTarget(player1.getId()));
|
||||
this.addEffect(effect);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever damage is dealt to one of the chosen players, "
|
||||
+ "the other chosen player also loses that much life.";
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public final class SpiralingDuelist extends CardImpl {
|
||||
|
||||
private static final String effectText = "Metalcraft - Spiraling Duelist has double strike as long as you control three or more artifacts.";
|
||||
private static final String effectText = "<i>Metalcraft</i> — Spiraling Duelist has double strike as long as you control three or more artifacts.";
|
||||
|
||||
public SpiralingDuelist(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}");
|
||||
|
|
|
@ -25,7 +25,7 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public final class SpireSerpent extends CardImpl {
|
||||
|
||||
private static final String abilityText1 = "Metalcraft - As long as you control three or more artifacts, {this} gets +2/+2";
|
||||
private static final String abilityText1 = "<i>Metalcraft</i> — As long as you control three or more artifacts, {this} gets +2/+2";
|
||||
|
||||
public SpireSerpent(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}");
|
||||
|
|
|
@ -23,7 +23,7 @@ public final class StoicRebuttal extends CardImpl {
|
|||
public StoicRebuttal(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}{U}");
|
||||
|
||||
// Metalcraft - Stoic Rebuttal costs {1} less to cast if you control three or more artifacts.
|
||||
// <i>Metalcraft</i> — Stoic Rebuttal costs {1} less to cast if you control three or more artifacts.
|
||||
Ability ability = new SimpleStaticAbility(Zone.STACK, new SpellCostReductionSourceEffect(1, MetalcraftCondition.instance));
|
||||
ability.setRuleAtTheTop(true);
|
||||
ability.setAbilityWord(AbilityWord.METALCRAFT);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
@ -57,7 +56,7 @@ class StoneIdolTrapCostReductionEffect extends CostModificationEffectImpl {
|
|||
|
||||
public StoneIdolTrapCostReductionEffect() {
|
||||
super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "{this} costs {1} less to cast for each attacking creature";
|
||||
staticText = "This spell costs {1} less to cast for each attacking creature";
|
||||
}
|
||||
|
||||
protected StoneIdolTrapCostReductionEffect(StoneIdolTrapCostReductionEffect effect) {
|
||||
|
|
|
@ -2,10 +2,14 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.ControlledCreaturesDealCombatDamagePlayerTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
|
@ -17,6 +21,7 @@ import mage.constants.ComparisonType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.TreasureToken;
|
||||
|
||||
/**
|
||||
|
@ -45,6 +50,8 @@ public final class StormTheVault extends CardImpl {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public StormTheVault(final StormTheVault card) {
|
||||
super(card);
|
||||
}
|
||||
|
|
65
Mage.Sets/src/mage/cards/t/ThantisTheWarweaver.java
Normal file
65
Mage.Sets/src/mage/cards/t/ThantisTheWarweaver.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksAllTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ThantisTheWarweaver extends CardImpl {
|
||||
|
||||
public ThantisTheWarweaver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}{G}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.SPIDER);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Vigilance
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
|
||||
// All creatures attack each combat if able.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new AttacksIfAbleAllEffect(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURES,
|
||||
Duration.WhileOnBattlefield, true
|
||||
).setText("All creatures attack each combat if able")
|
||||
));
|
||||
|
||||
// Whenever a creature attacks you or a planeswalker you control, put a +1/+1 counter on Thantis the Warweaver.
|
||||
this.addAbility(new AttacksAllTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
|
||||
false, true
|
||||
));
|
||||
}
|
||||
|
||||
public ThantisTheWarweaver(final ThantisTheWarweaver card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThantisTheWarweaver copy() {
|
||||
return new ThantisTheWarweaver(this);
|
||||
}
|
||||
}
|
|
@ -23,12 +23,12 @@ public final class TragicSlip extends CardImpl {
|
|||
|
||||
|
||||
// Target creature gets -1/-1 until end of turn.
|
||||
// Morbid - That creature gets -13/-13 until end of turn instead if a creature died this turn.
|
||||
// <i>Morbid</i> — That creature gets -13/-13 until end of turn instead if a creature died this turn.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
|
||||
new BoostTargetEffect(-13, -13, Duration.EndOfTurn),
|
||||
new BoostTargetEffect(-1, -1, Duration.EndOfTurn),
|
||||
new LockedInCondition(MorbidCondition.instance),
|
||||
"Target creature gets -1/-1 until end of turn. Morbid - That creature gets -13/-13 until end of turn instead if a creature died this turn"));
|
||||
"Target creature gets -1/-1 until end of turn. <i>Morbid</i> — That creature gets -13/-13 until end of turn instead if a creature died this turn"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class TravelersCloak extends CardImpl {
|
|||
|
||||
// Enchanted creature has landwalk of the chosen type.
|
||||
FilterLandPermanent filter = new FilterLandPermanent("Landwalk of the chosen type");
|
||||
filter.add(new ChosenSubtypePredicate(this.getId()));
|
||||
filter.add(new ChosenSubtypePredicate());
|
||||
Ability landwalkAbility = new LandwalkAbility(filter);
|
||||
Effect effect = new GainAbilityAttachedEffect(landwalkAbility, AttachmentType.AURA);
|
||||
effect.setText("Enchanted creature has landwalk of the chosen type");
|
||||
|
|
146
Mage.Sets/src/mage/cards/t/TreasureNabber.java
Normal file
146
Mage.Sets/src/mage/cards/t/TreasureNabber.java
Normal file
|
@ -0,0 +1,146 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class TreasureNabber extends CardImpl {
|
||||
|
||||
public TreasureNabber(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
|
||||
this.subtype.add(SubType.GOBLIN);
|
||||
this.subtype.add(SubType.ROGUE);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever an opponent taps an artifact for mana, gain control of that artifact until the end of your next turn.
|
||||
this.addAbility(new TreasureNabberAbility());
|
||||
}
|
||||
|
||||
public TreasureNabber(final TreasureNabber card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreasureNabber copy() {
|
||||
return new TreasureNabber(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TreasureNabberAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public TreasureNabberAbility() {
|
||||
super(Zone.BATTLEFIELD, new TreasureNabberEffect());
|
||||
}
|
||||
|
||||
public TreasureNabberAbility(TreasureNabberAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.TAPPED_FOR_MANA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null && permanent.isArtifact()) {
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreasureNabberAbility copy() {
|
||||
return new TreasureNabberAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent taps an artifact for mana, gain control of that artifact until the end of your next turn";
|
||||
}
|
||||
}
|
||||
|
||||
class TreasureNabberEffect extends ContinuousEffectImpl {
|
||||
|
||||
protected FixedTargets fixedTargets;
|
||||
protected int startingTurn;
|
||||
|
||||
TreasureNabberEffect() {
|
||||
super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
|
||||
this.staticText = "gain control of that artifact until the end of your next turn";
|
||||
startingTurn = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
startingTurn = game.getTurnNum();
|
||||
if (game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
|
||||
startingTurn = game.getTurnNum() + 1;
|
||||
}
|
||||
}
|
||||
|
||||
TreasureNabberEffect(final TreasureNabberEffect effect) {
|
||||
super(effect);
|
||||
this.fixedTargets = effect.fixedTargets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreasureNabberEffect copy() {
|
||||
return new TreasureNabberEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
if (startingTurn != 0 && game.getTurnNum() >= startingTurn && game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
|
||||
if (game.isActivePlayer(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
|
||||
if (permanent != null) {
|
||||
permanent.changeControllerId(source.getControllerId(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setTargets(List<Permanent> targetedPermanents, Game game) {
|
||||
this.fixedTargets = new FixedTargets(targetedPermanents, game);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue