mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
[ALA] Added 3 cards
This commit is contained in:
parent
c304b4e6da
commit
3fbb37f350
3 changed files with 437 additions and 0 deletions
131
Mage.Sets/src/mage/sets/shardsofalara/LichsMirror.java
Normal file
131
Mage.Sets/src/mage/sets/shardsofalara/LichsMirror.java
Normal file
|
@ -0,0 +1,131 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class LichsMirror extends CardImpl<LichsMirror> {
|
||||
|
||||
public LichsMirror(UUID ownerId) {
|
||||
super(ownerId, 210, "Lich's Mirror", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||
this.expansionSetCode = "ALA";
|
||||
|
||||
// If you would lose the game, instead shuffle your hand, your graveyard, and all permanents you own into your library, then draw seven cards and your life total becomes 20.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new LichsMirrorEffect()));
|
||||
}
|
||||
|
||||
public LichsMirror(final LichsMirror card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LichsMirror copy() {
|
||||
return new LichsMirror(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LichsMirrorEffect extends ReplacementEffectImpl<LichsMirrorEffect> {
|
||||
|
||||
public LichsMirrorEffect() {
|
||||
super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit);
|
||||
staticText = "If you would lose the game, instead shuffle your hand, your graveyard, and all permanents you own into your library, then draw seven cards and your life total becomes 20";
|
||||
}
|
||||
|
||||
public LichsMirrorEffect(final LichsMirrorEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LichsMirrorEffect copy() {
|
||||
return new LichsMirrorEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (player != null) {
|
||||
FilterControlledPermanent filter = new FilterControlledPermanent();
|
||||
filter.add(new OwnerIdPredicate(player.getId()));
|
||||
for (UUID uuid : player.getHand().copy()) {
|
||||
Card card = game.getCard(uuid);
|
||||
if (card != null) {
|
||||
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true);
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID uuid : player.getGraveyard().copy()) {
|
||||
Card card = game.getCard(uuid);
|
||||
if (card != null) {
|
||||
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true);
|
||||
}
|
||||
}
|
||||
|
||||
for(Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)){
|
||||
permanent.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
|
||||
player.drawCards(7, game);
|
||||
|
||||
player.setLife(20, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.LOSES && event.getPlayerId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
166
Mage.Sets/src/mage/sets/shardsofalara/QasaliAmbusher.java
Normal file
166
Mage.Sets/src/mage/sets/shardsofalara/QasaliAmbusher.java
Normal file
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class QasaliAmbusher extends CardImpl<QasaliAmbusher> {
|
||||
|
||||
public QasaliAmbusher(UUID ownerId) {
|
||||
super(ownerId, 184, "Qasali Ambusher", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{W}");
|
||||
this.expansionSetCode = "ALA";
|
||||
this.subtype.add("Cat");
|
||||
this.subtype.add("Warrior");
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
// If a creature is attacking you and you control a Forest and a Plains, you may casbt Qasali Ambusher without paying its mana cost and as though it had flash.
|
||||
this.addAbility(new QasaliAmbusherAbility());
|
||||
|
||||
}
|
||||
|
||||
public QasaliAmbusher(final QasaliAmbusher card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QasaliAmbusher copy() {
|
||||
return new QasaliAmbusher(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class QasaliAmbusherAbility extends ActivatedAbilityImpl<QasaliAmbusherAbility> {
|
||||
|
||||
private static final FilterControlledLandPermanent filterPlains = new FilterControlledLandPermanent();
|
||||
private static final FilterControlledLandPermanent filterForest = new FilterControlledLandPermanent();
|
||||
static {
|
||||
filterPlains.add(new SubtypePredicate("Plains"));
|
||||
filterForest.add(new SubtypePredicate("Forest"));
|
||||
}
|
||||
public QasaliAmbusherAbility() {
|
||||
super(Constants.Zone.HAND, new QasaliAmbusherEffect(), new ManaCostsImpl());
|
||||
this.timing = Constants.TimingRule.INSTANT;
|
||||
this.usesStack = false;
|
||||
}
|
||||
|
||||
public QasaliAmbusherAbility(final QasaliAmbusherAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QasaliAmbusherAbility copy() {
|
||||
return new QasaliAmbusherAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if(super.canActivate(playerId, game)){
|
||||
if(game.getBattlefield().getActivePermanents(filterPlains, this.getControllerId(), this.getSourceId(), game).size() > 0
|
||||
&& game.getBattlefield().getActivePermanents(filterForest, this.getControllerId(), this.getSourceId(), game).size() > 0){
|
||||
for(CombatGroup group : game.getCombat().getGroups()){
|
||||
if(group.getDefenderId().equals(getControllerId())){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule(boolean all) {
|
||||
return this.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "If a creature is attacking you and you control a Forest and a Plains, you may casbt Qasali Ambusher without paying its mana cost and as though it had flash";
|
||||
}
|
||||
}
|
||||
|
||||
class QasaliAmbusherEffect extends OneShotEffect<QasaliAmbusherEffect> {
|
||||
|
||||
public QasaliAmbusherEffect() {
|
||||
super(Constants.Outcome.Benefit);
|
||||
staticText = "";
|
||||
}
|
||||
|
||||
public QasaliAmbusherEffect(final QasaliAmbusherEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QasaliAmbusherEffect copy() {
|
||||
return new QasaliAmbusherEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = (Card) game.getObject(source.getSourceId());
|
||||
if (card != null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
SpellAbility spellAbility = card.getSpellAbility();
|
||||
|
||||
spellAbility.clear();
|
||||
return controller.cast(spellAbility, game, true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
140
Mage.Sets/src/mage/sets/shardsofalara/RealmRazer.java
Normal file
140
Mage.Sets/src/mage/sets/shardsofalara/RealmRazer.java
Normal file
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class RealmRazer extends CardImpl<RealmRazer> {
|
||||
|
||||
public RealmRazer(UUID ownerId) {
|
||||
super(ownerId, 187, "Realm Razer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{G}{W}");
|
||||
this.expansionSetCode = "ALA";
|
||||
this.subtype.add("Beast");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Realm Razer enters the battlefield, exile all lands.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new ExileAllEffect()));
|
||||
// When Realm Razer leaves the battlefield, return the exiled cards to the battlefield tapped under their owners' control.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new RealmRazerEffect(), false));
|
||||
}
|
||||
|
||||
public RealmRazer(final RealmRazer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealmRazer copy() {
|
||||
return new RealmRazer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ExileAllEffect extends OneShotEffect<ExileAllEffect> {
|
||||
|
||||
public ExileAllEffect() {
|
||||
super(Constants.Outcome.Exile);
|
||||
staticText = "exile all lands";
|
||||
}
|
||||
|
||||
public ExileAllEffect(final ExileAllEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExileAllEffect copy() {
|
||||
return new ExileAllEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getId(), game);
|
||||
for (Permanent permanent: permanents) {
|
||||
permanent.moveToExile(source.getSourceId(), "Realm Razer", source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class RealmRazerEffect extends OneShotEffect<RealmRazerEffect> {
|
||||
|
||||
public RealmRazerEffect() {
|
||||
super(Constants.Outcome.ReturnToHand);
|
||||
this.staticText = "return the exiled cards to the battlefield tapped under their owners' control";
|
||||
}
|
||||
|
||||
public RealmRazerEffect(final RealmRazerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealmRazerEffect copy() {
|
||||
return new RealmRazerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ExileZone exZone = game.getExile().getExileZone(source.getSourceId());
|
||||
if (exZone != null) {
|
||||
for (Card card : exZone.getCards(game)) {
|
||||
if (card != null) {
|
||||
if(card.putOntoBattlefield(game, Constants.Zone.EXILED, source.getSourceId(), card.getOwnerId())){
|
||||
game.getPermanent(card.getId()).setTapped(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue