mirror of
https://github.com/correl/mage.git
synced 2025-04-13 09:11:06 -09:00
Some minor changes to cards.
This commit is contained in:
parent
8af2b78f3c
commit
4665348ca7
6 changed files with 23 additions and 82 deletions
Mage.Sets/src/mage/sets
magic2015
onslaught
shardsofalara
tempest
zendikar
|
@ -30,6 +30,7 @@ package mage.sets.magic2015;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.DelayedTriggeredAbility;
|
import mage.abilities.DelayedTriggeredAbility;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -211,13 +212,13 @@ class ConstrictingSliverReturnExiledCreatureEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
|
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (exile != null && sourceCard != null) {
|
if (exile != null && sourceObject != null) {
|
||||||
LinkedList<UUID> cards = new LinkedList<>(exile);
|
LinkedList<UUID> cards = new LinkedList<>(exile);
|
||||||
for (UUID cardId : cards) {
|
for (UUID cardId : cards) {
|
||||||
Card card = game.getCard(cardId);
|
Card card = game.getCard(cardId);
|
||||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
|
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
|
||||||
}
|
}
|
||||||
exile.clear();
|
exile.clear();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -95,7 +95,7 @@ class HushwingGryffEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||||
MageObject mageObject = game.getObject(event.getSourceId());
|
MageObject mageObject = game.getObject(event.getSourceId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (mageObject != null && sourceObject != null) {
|
if (mageObject != null && sourceObject != null) {
|
||||||
return sourceObject + " prevented ability of " + mageObject + " to trigger";
|
return sourceObject.getLogName() + " prevented ability of " + mageObject.getLogName() + " to trigger";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
|
import mage.abilities.condition.common.OpponentControllsMoreCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||||
|
@ -67,7 +68,7 @@ public class WeatheredWayfarer extends CardImpl {
|
||||||
Zone.BATTLEFIELD,
|
Zone.BATTLEFIELD,
|
||||||
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterLandCard()), true, true),
|
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterLandCard()), true, true),
|
||||||
new ManaCostsImpl("{W}"),
|
new ManaCostsImpl("{W}"),
|
||||||
new OpponentControllsMoreLandCondition());
|
new OpponentControllsMoreCondition(new FilterLandPermanent("lands")));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
@ -81,24 +82,3 @@ public class WeatheredWayfarer extends CardImpl {
|
||||||
return new WeatheredWayfarer(this);
|
return new WeatheredWayfarer(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OpponentControllsMoreLandCondition implements Condition {
|
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterLandPermanent();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
int numLands = game.getBattlefield().countAll(filter, source.getControllerId(), game);
|
|
||||||
for (UUID opponentId: game.getOpponents(source.getControllerId())) {
|
|
||||||
if (numLands < game.getBattlefield().countAll(filter, opponentId, game)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "an opponent controls more lands than you";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -30,18 +30,16 @@ package mage.sets.shardsofalara;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.ZoneChangeTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
import mage.abilities.condition.common.OpponentControllsMoreCondition;
|
||||||
|
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||||
|
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||||
import mage.abilities.keyword.FirstStrikeAbility;
|
import mage.abilities.keyword.FirstStrikeAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.common.FilterBySubtypeCard;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
import mage.filter.common.FilterLandPermanent;
|
||||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
|
||||||
import mage.game.Game;
|
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,8 +57,15 @@ public class KnightOfTheWhiteOrchid extends CardImpl {
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
this.addAbility(new KnightOfTheWhiteOrchidAbility());
|
// First strike
|
||||||
this.addAbility(FirstStrikeAbility.getInstance());
|
this.addAbility(FirstStrikeAbility.getInstance());
|
||||||
|
|
||||||
|
// When Knight of the White Orchid enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library.
|
||||||
|
this.addAbility(new ConditionalTriggeredAbility(
|
||||||
|
new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterBySubtypeCard("Plains")), true), true),
|
||||||
|
new OpponentControllsMoreCondition(new FilterLandPermanent("lands")),
|
||||||
|
"When {this} enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KnightOfTheWhiteOrchid(final KnightOfTheWhiteOrchid card) {
|
public KnightOfTheWhiteOrchid(final KnightOfTheWhiteOrchid card) {
|
||||||
|
@ -73,40 +78,3 @@ public class KnightOfTheWhiteOrchid extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class KnightOfTheWhiteOrchidAbility extends ZoneChangeTriggeredAbility {
|
|
||||||
|
|
||||||
private static final FilterCard filter1 = new FilterCard("Plains");
|
|
||||||
private static final FilterLandPermanent filter2 = new FilterLandPermanent();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter1.add(new SubtypePredicate("Plains"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public KnightOfTheWhiteOrchidAbility() {
|
|
||||||
super(Zone.BATTLEFIELD, null, "When {this} enters the battlefield, if an opponent controls more lands than you, you may ", true);
|
|
||||||
TargetCardInLibrary target = new TargetCardInLibrary(filter1);
|
|
||||||
addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay));
|
|
||||||
}
|
|
||||||
|
|
||||||
public KnightOfTheWhiteOrchidAbility(final KnightOfTheWhiteOrchidAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public KnightOfTheWhiteOrchidAbility copy() {
|
|
||||||
return new KnightOfTheWhiteOrchidAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkInterveningIfClause(Game game) {
|
|
||||||
int numLands = game.getBattlefield().countAll(filter2, this.controllerId, game);
|
|
||||||
for (UUID opponentId: game.getOpponents(this.controllerId)) {
|
|
||||||
if (numLands < game.getBattlefield().countAll(filter2, opponentId, game)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -29,7 +29,6 @@ package mage.sets.tempest;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -46,7 +45,6 @@ import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.mageobject.NamePredicate;
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
import mage.game.permanent.token.SaprolingToken;
|
|
||||||
import mage.game.permanent.token.Token;
|
import mage.game.permanent.token.Token;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@ import mage.MageInt;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.common.FilterBySubtypeCard;
|
||||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,12 +43,6 @@ import mage.target.common.TargetCardInLibrary;
|
||||||
*/
|
*/
|
||||||
public class KorCartographer extends CardImpl {
|
public class KorCartographer extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("Plains card");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new SubtypePredicate("Plains"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public KorCartographer(UUID ownerId) {
|
public KorCartographer(UUID ownerId) {
|
||||||
super(ownerId, 18, "Kor Cartographer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
super(ownerId, 18, "Kor Cartographer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||||
this.expansionSetCode = "ZEN";
|
this.expansionSetCode = "ZEN";
|
||||||
|
@ -60,7 +53,8 @@ public class KorCartographer extends CardImpl {
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), true));
|
// When Kor Cartographer enters the battlefield, you may search your library for a Plains card, put it onto the battlefield tapped, then shuffle your library.
|
||||||
|
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBySubtypeCard("Plains")), true), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public KorCartographer(final KorCartographer card) {
|
public KorCartographer(final KorCartographer card) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue