mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
added couple lands (#3599)
* added couple lands * moved effect to own class
This commit is contained in:
parent
667dcb68af
commit
0792848f98
5 changed files with 151 additions and 43 deletions
|
@ -27,21 +27,16 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.effects.common.ReturnCreaturesFromExileEffect;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -60,7 +55,8 @@ public class ColdStorage extends CardImpl {
|
|||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
// Sacrifice Cold Storage: Return each creature card exiled with Cold Storage to the battlefield under your control.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromExileEffect(this.getId()), new SacrificeSourceCost());
|
||||
ReturnCreaturesFromExileEffect returnFromExileEffect = new ReturnCreaturesFromExileEffect(this.getId(), false, "Return each creature card exiled with {this} to the battlefield under your control");
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, returnFromExileEffect, new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -73,39 +69,3 @@ public class ColdStorage extends CardImpl {
|
|||
return new ColdStorage(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ReturnFromExileEffect extends OneShotEffect {
|
||||
|
||||
private UUID exileId;
|
||||
|
||||
public ReturnFromExileEffect(UUID exileId) {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.exileId = exileId;
|
||||
this.setText("Return each creature card exiled with {this} to the battlefield under your control");
|
||||
}
|
||||
|
||||
|
||||
public ReturnFromExileEffect(final ReturnFromExileEffect effect) {
|
||||
super(effect);
|
||||
this.exileId = effect.exileId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnFromExileEffect copy() {
|
||||
return new ReturnFromExileEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ExileZone exile = game.getExile().getExileZone(exileId);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && exile != null) {
|
||||
controller.moveCards(exile.getCards(new FilterCreatureCard(), game), Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
50
Mage.Sets/src/mage/cards/c/CryptOfTheEternals.java
Normal file
50
Mage.Sets/src/mage/cards/c/CryptOfTheEternals.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
public class CryptOfTheEternals extends CardImpl {
|
||||
|
||||
public CryptOfTheEternals(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
// When Crypt of the Eternals enters the battlefield, you gain 1 life.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(1)));
|
||||
|
||||
// {T}: Add {C} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {1}, {T}: Add {U}, {B}, or {R} to your mana pool.
|
||||
ArrayList<Mana> list = new ArrayList<Mana>() {{
|
||||
add(Mana.BlueMana(1));
|
||||
add(Mana.BlackMana(1));
|
||||
add(Mana.RedMana(1));
|
||||
}};
|
||||
|
||||
for(Mana m: list) {
|
||||
SimpleManaAbility uAbility = new SimpleManaAbility(Zone.BATTLEFIELD, m, new ManaCostsImpl("{1}"));
|
||||
uAbility.addCost(new TapSourceCost());
|
||||
this.addAbility(uAbility);
|
||||
}
|
||||
}
|
||||
|
||||
public CryptOfTheEternals(final CryptOfTheEternals card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CryptOfTheEternals copy() {
|
||||
return new CryptOfTheEternals(this);
|
||||
}
|
||||
}
|
50
Mage.Sets/src/mage/cards/e/EndlessSands.java
Normal file
50
Mage.Sets/src/mage/cards/e/EndlessSands.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.effects.common.ReturnCreaturesFromExileEffect;
|
||||
import java.util.UUID;
|
||||
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.common.ExileTargetEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
public class EndlessSands extends CardImpl {
|
||||
|
||||
public EndlessSands(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
this.subtype.add("Desert");
|
||||
|
||||
// {T}: Add {C} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {2}, {T}: Exile target creature you control.
|
||||
Ability exileAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(this.getId(), this.getIdName()), new ManaCostsImpl("{2}"));
|
||||
exileAbility.addCost(new TapSourceCost());
|
||||
exileAbility.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(exileAbility);
|
||||
|
||||
// {4}, {T}, Sacrifice Endless Sands: Return each creature card exiled with Endless Sands to the battlefield under its owner’s control.
|
||||
ReturnCreaturesFromExileEffect returnFromExileEffect = new ReturnCreaturesFromExileEffect(this.getId(), true, "Return each creature card exiled with {this} to the battlefield under its owner’s control.");
|
||||
Ability returnAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, returnFromExileEffect, new ManaCostsImpl("{4}"));
|
||||
returnAbility.addCost(new TapSourceCost());
|
||||
returnAbility.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(returnAbility);
|
||||
}
|
||||
|
||||
public EndlessSands(final EndlessSands card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndlessSands copy() {
|
||||
return new EndlessSands(this);
|
||||
}
|
||||
}
|
|
@ -98,6 +98,7 @@ public class HourOfDevastation extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Crash Through", 88, Rarity.COMMON, mage.cards.c.CrashThrough.class));
|
||||
cards.add(new SetCardInfo("Crested Sunmare", 6, Rarity.MYTHIC, mage.cards.c.CrestedSunmare.class));
|
||||
cards.add(new SetCardInfo("Crook of Condemnation", 159, Rarity.UNCOMMON, mage.cards.c.CrookOfCondemnation.class));
|
||||
cards.add(new SetCardInfo("Crypt of the Eternals", 169, Rarity.UNCOMMON, mage.cards.c.CryptOfTheEternals.class));
|
||||
cards.add(new SetCardInfo("Cunning Survivor", 33, Rarity.COMMON, mage.cards.c.CunningSurvivor.class));
|
||||
cards.add(new SetCardInfo("Dauntless Aven", 7, Rarity.COMMON, mage.cards.d.DauntlessAven.class));
|
||||
cards.add(new SetCardInfo("Defiant Khenra", 89, Rarity.COMMON, mage.cards.d.DefiantKhenra.class));
|
||||
|
@ -117,6 +118,7 @@ public class HourOfDevastation extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Driven // Despair", 157, Rarity.RARE, mage.cards.d.DrivenDespair.class));
|
||||
cards.add(new SetCardInfo("Dutiful Servants", 12, Rarity.COMMON, mage.cards.d.DutifulServants.class));
|
||||
cards.add(new SetCardInfo("Earthshaker Khenra", 90, Rarity.RARE, mage.cards.e.EarthshakerKhenra.class));
|
||||
cards.add(new SetCardInfo("Endless Sands", 176, Rarity.RARE, mage.cards.e.EndlessSands.class));
|
||||
cards.add(new SetCardInfo("Eternal of Harsh Truths", 34, Rarity.UNCOMMON, mage.cards.e.EternalOfHarshTruths.class));
|
||||
cards.add(new SetCardInfo("Farm // Market", 148, Rarity.UNCOMMON, mage.cards.f.FarmMarket.class));
|
||||
cards.add(new SetCardInfo("Feral Prowler", 115, Rarity.COMMON, mage.cards.f.FeralProwler.class));
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
public class ReturnCreaturesFromExileEffect extends OneShotEffect {
|
||||
|
||||
private UUID exileId;
|
||||
private boolean byOwner;
|
||||
|
||||
public ReturnCreaturesFromExileEffect(UUID exileId, boolean byOwner, String description) {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.exileId = exileId;
|
||||
this.setText(description);
|
||||
this.byOwner = byOwner;
|
||||
}
|
||||
|
||||
|
||||
public ReturnCreaturesFromExileEffect(final ReturnCreaturesFromExileEffect effect) {
|
||||
super(effect);
|
||||
this.exileId = effect.exileId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnCreaturesFromExileEffect copy() {
|
||||
return new ReturnCreaturesFromExileEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ExileZone exile = game.getExile().getExileZone(exileId);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && exile != null) {
|
||||
controller.moveCards(exile.getCards(new FilterCreatureCard(), game), Zone.BATTLEFIELD, source, game, false, false, this.byOwner, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue