Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michael Simons 2018-06-07 22:41:40 -04:00
commit d5ad543583
278 changed files with 2275 additions and 706 deletions

View file

@ -1,4 +1,3 @@
package mage.utils;
import java.io.Serializable;
@ -15,7 +14,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 30;
public final static String MAGE_VERSION_MINOR_PATCH = "V2";
public final static String MAGE_VERSION_MINOR_PATCH = "V3";
public final static String MAGE_VERSION_INFO = "";
private final int major;

View file

@ -132,8 +132,8 @@ public class SimulatedPlayer2 extends ComputerPlayer {
if (variableManaCost != null) {
int multiplier = variableManaCost.getMultiplier();
for (int mana = 0; mana <= numAvailable; mana++) {
if (mana % multiplier == 0) { // use only values dependant from muliplier
for (int mana = variableManaCost.getMinX(); mana <= numAvailable; mana++) {
if (mana % multiplier == 0) { // use only values dependant from multiplier
int xAmount = mana / multiplier;
Ability newAbility = ability.copy();
VariableManaCost varCost = null;

View file

@ -70,7 +70,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
private static final Logger log = Logger.getLogger(ComputerPlayer.class);
protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are availble
protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are available
protected boolean ALLOW_INTERRUPT = true; // change this for test to false / debugging purposes to false to switch off interrupts while debugging
private transient Map<Mana, Card> unplayable = new TreeMap<>();
@ -279,9 +279,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = threats(randomOpponentId, sourceId, ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets());
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(abilityControllerId, permanent.getId(), null, game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.add(permanent.getId(), game);
return true;
}
@ -312,9 +312,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = opponentTargets;
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(permanent.getId(), game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.add(permanent.getId(), game);
return true;
}
@ -346,9 +346,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = ownedTargets;
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(permanent.getId(), game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.add(permanent.getId(), game);
return true;
}
@ -376,11 +376,11 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (target.getOriginalTarget() instanceof TargetCardInYourGraveyard
|| target.getOriginalTarget() instanceof TargetCardInASingleGraveyard) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
List<Card> cards = new ArrayList<>(game.getPlayer(abilityControllerId).getGraveyard().getCards((FilterCard) target.getFilter(), game));
while (!cards.isEmpty()) {
Card card = pickTarget(cards, outcome, target, null, game);
if (card != null && alreadyTargetted != null && !alreadyTargetted.contains(card.getId())) {
if (card != null && alreadyTargeted != null && !alreadyTargeted.contains(card.getId())) {
target.add(card.getId(), game);
if (target.isChosen()) {
return true;
@ -396,9 +396,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
for (UUID targetId : targets) {
MageObject targetObject = game.getObject(targetId);
if (targetObject != null) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(targetObject.getId(), game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(targetObject.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(targetObject.getId())) {
target.add(targetObject.getId(), game);
return true;
}
@ -547,9 +547,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = game.getBattlefield().getActivePermanents(((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), playerId, game);
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(abilityControllerId, permanent.getId(), source, game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.addTarget(permanent.getId(), source, game);
return true;
}
@ -594,9 +594,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = game.getBattlefield().getActivePermanents(((FilterCreaturePlayerOrPlaneswalker) t.getFilter()).getCreatureFilter(), playerId, game);
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(abilityControllerId, permanent.getId(), source, game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.addTarget(permanent.getId(), source, game);
return true;
}
@ -641,9 +641,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = game.getBattlefield().getActivePermanents(((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), playerId, game);
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(abilityControllerId, permanent.getId(), source, game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.addTarget(permanent.getId(), source, game);
return true;
}
@ -676,9 +676,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
targets = game.getBattlefield().getActivePermanents(((TargetPlayerOrPlaneswalker) t.getFilter()).getFilterPermanent(), playerId, game);
}
for (Permanent permanent : targets) {
List<UUID> alreadyTargetted = target.getTargets();
List<UUID> alreadyTargeted = target.getTargets();
if (t.canTarget(abilityControllerId, permanent.getId(), source, game)) {
if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) {
if (alreadyTargeted != null && !alreadyTargeted.contains(permanent.getId())) {
target.addTarget(permanent.getId(), source, game);
return true;
}
@ -1382,7 +1382,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
private Abilities<ActivatedManaAbilityImpl> getManaAbilitiesSortedByManaCount(MageObject mageObject, final Game game) {
Abilities<ActivatedManaAbilityImpl> manaAbilities = mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, game);
if (manaAbilities.size() > 1) {
// Sort mana abilities by numbver of produced manas, to use ability first that produces most mana (maybe also conditional if possible)
// Sort mana abilities by number of produced manas, to use ability first that produces most mana (maybe also conditional if possible)
Collections.sort(manaAbilities, new Comparator<ActivatedManaAbilityImpl>() {
@Override
public int compare(ActivatedManaAbilityImpl a1, ActivatedManaAbilityImpl a2) {
@ -1472,18 +1472,25 @@ public class ComputerPlayer extends PlayerImpl implements Player {
int numAvailable = getAvailableManaProducers(game).size() - ability.getManaCosts().convertedManaCost();
if (numAvailable < 0) {
numAvailable = 0;
}
if (numAvailable > max) {
numAvailable = max;
} else {
if (numAvailable < min) {
numAvailable = min;
}
if (numAvailable > max) {
numAvailable = max;
}
}
return numAvailable;
}
@Override
public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variablCost) {
log.debug("announceXMana");
log.debug("announceXCost");
//TODO: improve this
int value = RandomUtil.nextInt(max + 1);
if (value < min) {
value = min;
}
if (value < max) {
value++;
}
@ -1902,7 +1909,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
}
double total = mana.getBlack() + mana.getBlue() + mana.getGreen() + mana.getRed() + mana.getWhite();
// most frequent land is forest by defalt
// most frequent land is forest by default
int mostLand = 0;
String mostLandName = "Forest";
if (mana.getGreen() > 0) {
@ -1999,7 +2006,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
// but also check it can be targeted
betterCard = target.canTarget(getId(), card.getId(), source, game);
} else {
// target object wasn't provided, so acceptings it anyway
// target object wasn't provided, so accepting it anyway
betterCard = true;
}
}

View file

@ -49,7 +49,7 @@ public final class Aetherspouts extends CardImpl {
of their library. The active player (the player whose turn it is) makes all of
their choices first, followed by each other player in turn order.
7/18/2014 If an effect puts two or more cards on the top or bottom of a library at the same time,
the owner of those cards may arrange them in any order. That librarys owner doesnt reveal
the owner of those cards may arrange them in any order. That library's owner doesn't reveal
the order in which the cards go into their library.
*/
class AetherspoutsEffect extends OneShotEffect {

View file

@ -45,7 +45,7 @@ public final class AngrathMinotaurPirate extends CardImpl {
Effects effects1 = new Effects();
effects1.add(new DamageTargetEffect(1));
effects1.add(new DamageAllControlledTargetEffect(1, new FilterCreaturePermanent())
.setText("and each creature that player or that planeswalkers controller controls")
.setText("and each creature that player or that planeswalker's controller controls")
);
LoyaltyAbility ability1 = new LoyaltyAbility(effects1, +2);
ability1.addTarget(new TargetOpponentOrPlaneswalker());

View file

@ -53,7 +53,7 @@ public final class AntiMagicAura extends CardImpl {
}
}
// 9/25/2006 ruling: If Consecrate Land enters the battlefield attached to a land thats enchanted by other Auras, those Auras are put into their owners graveyards.
// 9/25/2006 ruling: If Consecrate Land enters the battlefield attached to a land that's enchanted by other Auras, those Auras are put into their owners' graveyards.
class AntiMagicAuraRuleEffect extends ContinuousRuleModifyingEffectImpl {
public AntiMagicAuraRuleEffect() {

View file

@ -0,0 +1,142 @@
package mage.cards.a;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
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.Zone;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author TheElk801
*/
public final class ApexOfPower extends CardImpl {
public ApexOfPower(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{R}{R}{R}");
// Exile the top seven cards of your library. Until end of turn, you may cast nonland cards exiled this way.
this.getSpellAbility().addEffect(new ApexOfPowerSpellEffect());
// If this spell was cast from your hand, add ten mana of any one color.
this.getSpellAbility().addEffect(new ApexOfPowerManaEffect());
}
public ApexOfPower(final ApexOfPower card) {
super(card);
}
@Override
public ApexOfPower copy() {
return new ApexOfPower(this);
}
}
class ApexOfPowerSpellEffect extends OneShotEffect {
public ApexOfPowerSpellEffect() {
super(Outcome.Benefit);
this.staticText = "exile the top seven cards of your library. Until end of turn, you may cast nonland cards exiled this way";
}
public ApexOfPowerSpellEffect(final ApexOfPowerSpellEffect effect) {
super(effect);
}
@Override
public ApexOfPowerSpellEffect copy() {
return new ApexOfPowerSpellEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller == null || sourceObject == null) {
return false;
}
Set<Card> cards = controller.getLibrary().getTopCards(game, 7);
if (cards.isEmpty()) {
return false;
}
controller.moveCards(cards, Zone.EXILED, source, game);
for (Card card : cards) {
if (card.isLand()) {
continue;
}
ContinuousEffect effect = new ApexOfPowerCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
game.addEffect(effect, source);
}
return true;
}
}
class ApexOfPowerCastFromExileEffect extends AsThoughEffectImpl {
public ApexOfPowerCastFromExileEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit);
staticText = "You may play the card from exile";
}
public ApexOfPowerCastFromExileEffect(final ApexOfPowerCastFromExileEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public ApexOfPowerCastFromExileEffect copy() {
return new ApexOfPowerCastFromExileEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
return source.getControllerId().equals(affectedControllerId)
&& objectId.equals(getTargetPointer().getFirst(game, source));
}
}
class ApexOfPowerManaEffect extends OneShotEffect {
public ApexOfPowerManaEffect() {
super(Outcome.Benefit);
this.staticText = "If this spell was cast from your hand, add ten mana of any one color.";
}
public ApexOfPowerManaEffect(final ApexOfPowerManaEffect effect) {
super(effect);
}
@Override
public ApexOfPowerManaEffect copy() {
return new ApexOfPowerManaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(source.getSourceId());
if (spell == null || spell.getFromZone() != Zone.HAND) {
return false;
}
return new AddManaOfAnyColorEffect(10).apply(game, source);
}
}

View file

@ -35,7 +35,7 @@ public final class ApocalypseDemon extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Apocalypse Demons power and toughness are each equal to the number of cards in your graveyard.
// Apocalypse Demon's power and toughness are each equal to the number of cards in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerGraveyardCount(), Duration.EndOfGame)));
// At the beginning of your upkeep, tap Apocalypse Demon unless you sacrifice another creature.

View file

@ -37,7 +37,7 @@ public final class AquaticIncursion extends CardImpl {
// When Aquatic Incursion enters the battlefield, create two 1/1 blue Merfolk creature tokens with hexproof.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MerfolkHexproofToken(), 2), false));
// {3}{U}: Target Merfolk cant be blocked this turn.
// {3}{U}: Target Merfolk can't be blocked this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{3}{U}"));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);

View file

@ -64,7 +64,7 @@ class ArchfiendOfDespairEffect extends OneShotEffect {
public ArchfiendOfDespairEffect() {
super(Outcome.LoseLife);
this.staticText = "each opponent loses life equal to the life he or she lost this turn";
this.staticText = "each opponent loses life equal to the life that player lost this turn";
}
public ArchfiendOfDespairEffect(final ArchfiendOfDespairEffect effect) {

View file

@ -34,7 +34,7 @@ import mage.util.CardUtil;
public final class ArchonOfValorsReach extends CardImpl {
public ArchonOfValorsReach(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{W}");
this.subtype.add(SubType.ARCHON);
this.power = new MageInt(5);

View file

@ -0,0 +1,92 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author TheElk801
*/
public final class AssemblyHall extends CardImpl {
public AssemblyHall(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
// {4}, {tap}: Reveal a creature card in your hand. Search your library for a card with the same name as that card, reveal it, and put it into your hand. Then shuffle your library.
Ability ability = new SimpleActivatedAbility(new AssemblyHallEffect(), new GenericManaCost(4));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public AssemblyHall(final AssemblyHall card) {
super(card);
}
@Override
public AssemblyHall copy() {
return new AssemblyHall(this);
}
}
class AssemblyHallEffect extends OneShotEffect {
public AssemblyHallEffect() {
super(Outcome.Benefit);
this.staticText = "reveal a creature card from your hand. "
+ "Search your library for a card with the same name as that card, "
+ "reveal it, and put it into your hand. Then shuffle your library";
}
public AssemblyHallEffect(final AssemblyHallEffect effect) {
super(effect);
}
@Override
public AssemblyHallEffect copy() {
return new AssemblyHallEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller == null || controller.getHand().isEmpty() || sourceObject == null) {
return false;
}
Card cardToReveal = null;
Target target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE);
target.setNotTarget(true);
if (controller.chooseTarget(outcome, target, source, game)) {
cardToReveal = game.getCard(target.getFirstTarget());
}
if (cardToReveal == null) {
return false;
}
controller.revealCards("from hand :" + sourceObject.getName(), new CardsImpl(cardToReveal), game);
String nameToSearch = cardToReveal.isSplitCard() ? ((SplitCard) cardToReveal).getLeftHalfCard().getName() : cardToReveal.getName();
FilterCard filterCard = new FilterCard("card named " + nameToSearch);
filterCard.add(new NamePredicate(nameToSearch));
return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source);
}
}

View file

@ -42,7 +42,7 @@ public final class AzorTheLawbringer extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Azor, the Lawbringer enters the battlefield, each opponent cant cast instant or sorcery spells during that players next turn.
// When Azor, the Lawbringer enters the battlefield, each opponent can't cast instant or sorcery spells during that player's next turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new AzorTheLawbringerEntersBattlefieldEffect(), false));
// Whenever Azor attacks, you may pay {X}{W}{U}{U}. If you do, you gain X life and draw X cards.

View file

@ -84,7 +84,7 @@ public final class BalanWanderingKnight extends CardImpl {
filter.add(new SubtypePredicate(SubType.EQUIPMENT));
for (Permanent equipment : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(),game)) {
if (equipment != null) {
//If an Equipment cant equip, it isnt attached, and it doesnt become unattached (if its attached to a creature).
//If an Equipment can't equip, it isn't attached, and it doesn't become unattached (if it's attached to a creature).
if (!balan.cantBeAttachedBy(equipment, game)) {
balan.addAttachment(equipment.getId(), game);
}

View file

@ -134,7 +134,7 @@ class BalduvianWarlordUnblockEffect extends OneShotEffect {
if (chosenGroup != null) {
// Relevant ruling for Balduvian Warlord:
// 7/15/2006 If an attacking creature has an ability that triggers When this creature becomes blocked,
// it triggers when a creature blocks it due to the Warlords ability only if it was unblocked at that point.
// it triggers when a creature blocks it due to the Warlord's ability only if it was unblocked at that point.
boolean notYetBlocked = chosenGroup.getBlockers().isEmpty();
chosenGroup.addBlockerToGroup(permanent.getId(), controller.getId(), game);
game.getCombat().addBlockingGroup(permanent.getId(), chosenPermanent.getId(), controller.getId(), game); // 702.21h

View file

@ -0,0 +1,98 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SpellCastAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileGraveyardAllPlayersEffect;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public final class BazaarOfWonders extends CardImpl {
public BazaarOfWonders(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
this.addSuperType(SuperType.WORLD);
// When Bazaar of Wonders enters the battlefield, exile all cards from all graveyards.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ExileGraveyardAllPlayersEffect()));
// Whenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
this.addAbility(new SpellCastAllTriggeredAbility(new BazaarOfWondersEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL));
}
public BazaarOfWonders(final BazaarOfWonders card) {
super(card);
}
@Override
public BazaarOfWonders copy() {
return new BazaarOfWonders(this);
}
}
class BazaarOfWondersEffect extends OneShotEffect {
public BazaarOfWondersEffect() {
super(Outcome.Benefit);
this.staticText = "counter it if a card with the same name is in a graveyard "
+ "or a nontoken permanent with the same name is on the battlefield";
}
public BazaarOfWondersEffect(final BazaarOfWondersEffect effect) {
super(effect);
}
@Override
public BazaarOfWondersEffect copy() {
return new BazaarOfWondersEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getSpell(targetPointer.getFirst(game, source));
if (spell == null) {
return false;
}
String spellName = spell.getName();
FilterPermanent filter1 = new FilterPermanent();
filter1.add(new NamePredicate(spellName));
filter1.add(Predicates.not(new TokenPredicate()));
if (!game.getBattlefield().getActivePermanents(filter1, source.getControllerId(), game).isEmpty()) {
spell.counter(source.getControllerId(), game);
return true;
}
FilterCard filter2 = new FilterCard();
filter2.add(new NamePredicate(spellName));
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
if (player.getGraveyard().count(filter2, game) > 0) {
spell.counter(source.getControllerId(), game);
return true;
}
}
return false;
}
}

View file

@ -45,7 +45,7 @@ class BlightningEffect extends OneShotEffect {
BlightningEffect() {
super(Outcome.Benefit);
this.staticText = "That player or that planeswalkers controller discards two cards.";
this.staticText = "That player or that planeswalker's controller discards two cards.";
}
BlightningEffect(final BlightningEffect effect) {

View file

@ -25,7 +25,7 @@ public final class BloodFeud extends CardImpl {
target.setTargetTag(1);
this.getSpellAbility().addTarget(target);
FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature");
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new AnotherTargetPredicate(2));
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter);
target2.setTargetTag(2);

View file

@ -0,0 +1,93 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
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.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.counters.Counters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public final class BogardanPhoenix extends CardImpl {
public BogardanPhoenix(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}");
this.subtype.add(SubType.PHOENIX);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Bogardan Phoenix dies, exile it if it had a death counter on it. Otherwise, return it to the battlefield under your control and put a death counter on it.
this.addAbility(new DiesTriggeredAbility(new BogardanPhoenixEffect(), false));
}
public BogardanPhoenix(final BogardanPhoenix card) {
super(card);
}
@Override
public BogardanPhoenix copy() {
return new BogardanPhoenix(this);
}
}
class BogardanPhoenixEffect extends OneShotEffect {
public BogardanPhoenixEffect() {
super(Outcome.Benefit);
this.staticText = "exile it if it had a death counter on it. "
+ "Otherwise, return it to the battlefield under your control "
+ "and put a death counter on it.";
}
public BogardanPhoenixEffect(final BogardanPhoenixEffect effect) {
super(effect);
}
@Override
public BogardanPhoenixEffect copy() {
return new BogardanPhoenixEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
if (permanent == null
|| controller == null
|| permanent.getZoneChangeCounter(game) + 1
!= source.getSourceObjectZoneChangeCounter()) {
return false;
}
Card card = game.getCard(permanent.getId());
if (card == null || card.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) {
return false;
}
if (permanent.getCounters(game).containsKey(CounterType.DEATH)) {
return controller.moveCards(card, Zone.EXILED, source, game);
} else {
Counters countersToAdd = new Counters();
countersToAdd.addCounter(CounterType.DEATH.createInstance());
game.setEnterWithCounters(source.getSourceId(), countersToAdd);
return controller.moveCards(card, Zone.BATTLEFIELD, source, game);
}
}
}

View file

@ -50,7 +50,7 @@ class BonfireOfTheDamnedEffect extends OneShotEffect {
public BonfireOfTheDamnedEffect() {
super(Outcome.Damage);
staticText = "{this} deals X damage to target player or planeswalker and each creature that player or that planeswalkers controller controls";
staticText = "{this} deals X damage to target player or planeswalker and each creature that player or that planeswalker's controller controls";
}
public BonfireOfTheDamnedEffect(final BonfireOfTheDamnedEffect effect) {

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +25,7 @@ public final class BrainPry extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}");
//Name a nonland card. Target player reveals their hand. That player discards a card with that name. If he or she can't, you draw a card.
this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME)));
this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)));
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new BrainPryEffect());
}
@ -56,7 +56,7 @@ class BrainPryEffect extends OneShotEffect {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (targetPlayer != null && controller != null && sourceObject != null && cardName != null) {
boolean hasDiscarded = false;
for (Card card : targetPlayer.getHand().getCards(game)) {

View file

@ -1,4 +1,3 @@
package mage.cards.b;
import java.util.UUID;
@ -107,6 +106,7 @@ class BrightlingEffect extends OneShotEffect {
return false;
}
int boost = (player.chooseUse(outcome, "Give +1/-1 or -1/+1?", null, "+1/-1", "-1/+1", source, game) ? 1 : -1);
return new BoostSourceEffect(boost, -1 * boost, Duration.EndOfTurn).apply(game, source);
game.addEffect(new BoostSourceEffect(boost, -1 * boost, Duration.EndOfTurn), source);
return true;
}
}

View file

@ -0,0 +1,88 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RevealTargetFromHandCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInHand;
/**
*
* @author TheElk801
*/
public final class BrineSeer extends CardImpl {
public BrineSeer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {2}{U}, {tap}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.
Ability ability = new SimpleActivatedAbility(new BrineSeerEffect(), new ManaCostsImpl("{2}{U}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetSpell());
this.addAbility(ability);
}
public BrineSeer(final BrineSeer card) {
super(card);
}
@Override
public BrineSeer copy() {
return new BrineSeer(this);
}
}
class BrineSeerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("any number of blue cards in your hand");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public BrineSeerEffect() {
super(Outcome.Detriment);
this.staticText = "reveal any number of blue cards in your hand. "
+ "Counter target spell unless its controller pays {1} for each card revealed this way";
}
public BrineSeerEffect(final BrineSeerEffect effect) {
super(effect);
}
@Override
public BrineSeerEffect copy() {
return new BrineSeerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
return false;
}
int xValue = cost.getNumberRevealedCards();
return new CounterUnlessPaysEffect(new GenericManaCost(xValue)).apply(game, source);
}
}

View file

@ -1,11 +1,10 @@
package mage.cards.c;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.*;
import mage.constants.CardType;
@ -26,10 +25,10 @@ import java.util.UUID;
public final class CabalTherapy extends CardImpl {
public CabalTherapy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}");
// Name a nonland card. Target player reveals their hand and discards all cards with that name.
this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME)));
this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)));
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new CabalTherapyEffect());
@ -53,7 +52,7 @@ class CabalTherapyEffect extends OneShotEffect {
public CabalTherapyEffect() {
super(Outcome.Discard);
staticText = "Name a nonland card. Target player reveals their hand and discards all cards with that name";
staticText = "Target player reveals their hand and discards all cards with that name";
}
public CabalTherapyEffect(final CabalTherapyEffect effect) {
@ -66,16 +65,15 @@ class CabalTherapyEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (targetPlayer != null && controller != null && sourceObject != null) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
Cards hand = targetPlayer.getHand();
for (Card card : hand.getCards(game)) {
if(card.isSplitCard()){
if (card.isSplitCard()) {
SplitCard splitCard = (SplitCard) card;
if(splitCard.getLeftHalfCard().getName().equals(cardName)){
if (splitCard.getLeftHalfCard().getName().equals(cardName)) {
targetPlayer.discard(card, source, game);
}
else if(splitCard.getRightHalfCard().getName().equals(cardName)){
} else if (splitCard.getRightHalfCard().getName().equals(cardName)) {
targetPlayer.discard(card, source, game);
}
}

View file

@ -37,7 +37,7 @@ public final class CelestialColonnade extends CardImpl {
this.addAbility(new BlueManaAbility());
this.addAbility(new WhiteManaAbility());
// {3}{W}{U}: Until end of turn, Celestial Colonnade becomes a 4/4 white and blue Elemental creature with flying and vigilance. Its still a land.
// {3}{W}{U}: Until end of turn, Celestial Colonnade becomes a 4/4 white and blue Elemental creature with flying and vigilance. It's still a land.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(4, 4, "4/4 white and blue Elemental creature with flying and vigilance")
.withColor("WU")

View file

@ -78,11 +78,11 @@ class CelestialConvergenceEffect extends OneShotEffect {
/**
* 801.14. If an effect states that a player wins the game, all of
* that players opponents within their range of influence lose the
* that player's opponents within their range of influence lose the
* game instead. #
*
* 801.15. If the effect of a spell or ability states that the game
* is a draw, the game is a draw for that spell or abilitys
* is a draw, the game is a draw for that spell or ability's
* controller and all players within their range of influence. They
* leave the game. All remaining players continue to play the game.
*

View file

@ -44,7 +44,7 @@ class ChainLightningEffect extends OneShotEffect {
ChainLightningEffect() {
super(Outcome.Damage);
this.staticText = "Chain Lightning deals 3 damage to any target. Then that player or that creature's controller may pay {R}{R}. If the player does, he or she may copy this spell and may choose a new target for that copy.";
this.staticText = "{this} deals 3 damage to any target. Then that player or that permanent's controller may pay {R}{R}. If the player does, they may copy this spell and may choose a new target for that copy";
}
ChainLightningEffect(final ChainLightningEffect effect) {

View file

@ -50,7 +50,7 @@ public final class ChandraNalaar extends CardImpl {
Effects effects1 = new Effects();
effects1.add(new DamageTargetEffect(10));
effects1.add(new DamageAllControlledTargetEffect(10, new FilterCreaturePermanent())
.setText("and each creature that player or that planeswalkers controller controls")
.setText("and each creature that player or that planeswalker's controller controls")
);
LoyaltyAbility ability3 = new LoyaltyAbility(effects1, -8);
ability3.addTarget(new TargetPlayerOrPlaneswalker());

View file

@ -45,7 +45,7 @@ public final class ChandraPyrogenius extends CardImpl {
Effects effects = new Effects();
effects.add(new DamageTargetEffect(6));
effects.add(new DamageAllControlledTargetEffect(6, new FilterCreaturePermanent())
.setText("and each creature that player or that planeswalkers controller controls")
.setText("and each creature that player or that planeswalker's controller controls")
);
ability = new LoyaltyAbility(effects, -10);
ability.addTarget(new TargetPlayerOrPlaneswalker());

View file

@ -71,7 +71,7 @@ class ChandraPyromasterEffect1 extends OneShotEffect {
public ChandraPyromasterEffect1() {
super(Outcome.Damage);
staticText = "{this} deals 1 damage to target player or planeswalker and 1 damage to up to one target creature that player or that planeswalkers controller controls. That creature cant block this turn.";
staticText = "{this} deals 1 damage to target player or planeswalker and 1 damage to up to one target creature that player or that planeswalker's controller controls. That creature can't block this turn.";
}
public ChandraPyromasterEffect1(final ChandraPyromasterEffect1 effect) {

View file

@ -1,4 +1,3 @@
package mage.cards.c;
import java.util.UUID;
@ -22,7 +21,6 @@ import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.command.emblems.ChandraTorchOfDefianceEmblem;
import mage.players.Library;
@ -92,10 +90,10 @@ class ChandraTorchOfDefianceEffect extends OneShotEffect {
Card card = library.getFromTop(game);
if (card != null) {
boolean exiledCardWasCast = false;
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
if (!card.getManaCost().isEmpty()) {
if (controller.chooseUse(Outcome.Benefit, "Cast the card? (You still pay the costs)", source, game) && !card.isLand()) {
exiledCardWasCast = controller.cast(card.getSpellAbility(), game, false, new MageObjectReference(source.getSourceObject(game), game));
controller.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName());
if (!card.getManaCost().isEmpty() && !card.isLand()) {
if (controller.chooseUse(Outcome.Benefit, "Cast " + card.getName() + "? (You still pay the costs)", source, game)) {
exiledCardWasCast = controller.cast(card.getSpellAbility(), game, false, new MageObjectReference(sourceObject, game));
}
}
if (!exiledCardWasCast) {

View file

@ -22,7 +22,7 @@ public final class ChandrasFury extends CardImpl {
// Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addEffect(new DamageAllControlledTargetEffect(1, new FilterCreaturePermanent())
.setText("and each creature that player or that planeswalkers controller controls")
.setText("and each creature that player or that planeswalker's controller controls")
);
this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
}

View file

@ -0,0 +1,82 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
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.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class ChariotOfTheSun extends CardImpl {
public ChariotOfTheSun(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// {2}, {tap}: Until end of turn, target creature you control gains flying and its toughness becomes 1.
Ability ability = new SimpleActivatedAbility(
new GainAbilityTargetEffect(
FlyingAbility.getInstance(),
Duration.EndOfTurn,
"until end of turn, target creature you control gains flying"
),
new GenericManaCost(2)
);
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent());
ability.addEffect(new ChariotOfTheSunEffect());
this.addAbility(ability);
}
public ChariotOfTheSun(final ChariotOfTheSun card) {
super(card);
}
@Override
public ChariotOfTheSun copy() {
return new ChariotOfTheSun(this);
}
}
class ChariotOfTheSunEffect extends ContinuousEffectImpl {
public ChariotOfTheSunEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.UnboostCreature);
staticText = "and its toughness becomes 1";
}
public ChariotOfTheSunEffect(final ChariotOfTheSunEffect effect) {
super(effect);
}
@Override
public ChariotOfTheSunEffect copy() {
return new ChariotOfTheSunEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent == null) {
this.discard();
return false;
}
permanent.getToughness().setValue(1);
return true;
}
}

View file

@ -7,8 +7,8 @@ import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.NameACardEffect.TypeOfName;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.ChooseACardNameEffect.TypeOfName;
import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
@ -65,8 +65,8 @@ class CheeringFanaticEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
new NameACardEffect(TypeOfName.ALL).apply(game, source);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
FilterCard filter = new FilterCard();
filter.add(new NamePredicate(cardName));
ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1);

View file

@ -1,4 +1,3 @@
package mage.cards.c;
import java.util.ArrayList;
@ -127,8 +126,9 @@ class ChromeMoxManaEffect extends ManaEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
checkToFirePossibleEvents(getMana(game, source), game, source);
controller.getManaPool().addMana(getMana(game, source), game, source);
Mana mana = getMana(game, source);
checkToFirePossibleEvents(mana, game, source);
controller.getManaPool().addMana(mana, game, source);
return true;
}

View file

@ -0,0 +1,87 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RevealTargetFromHandCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.target.common.TargetAnyTarget;
import mage.target.common.TargetCardInHand;
/**
*
* @author TheElk801
*/
public final class CinderSeer extends CardImpl {
public CinderSeer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {2}{R}, {tap}: Reveal any number of red cards in your hand. Cinder Seer deals X damage to any target, where X is the number of cards revealed this way.
Ability ability = new SimpleActivatedAbility(new CinderSeerEffect(), new ManaCostsImpl("{2}{R}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
}
public CinderSeer(final CinderSeer card) {
super(card);
}
@Override
public CinderSeer copy() {
return new CinderSeer(this);
}
}
class CinderSeerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("any number of red cards in your hand");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public CinderSeerEffect() {
super(Outcome.Damage);
this.staticText = "reveal any number of red cards in your hand. "
+ "{this} deals X damage to any target, where X is the number of cards revealed this way";
}
public CinderSeerEffect(final CinderSeerEffect effect) {
super(effect);
}
@Override
public CinderSeerEffect copy() {
return new CinderSeerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
return false;
}
int xValue = cost.getNumberRevealedCards();
return new DamageTargetEffect(xValue).apply(game, source);
}
}

View file

@ -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 planeswalkers controller cant block this turn.";
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.";
}
public ConcussiveBoltEffect(final ConcussiveBoltEffect effect) {

View file

@ -53,7 +53,7 @@ public final class ConsecrateLand extends CardImpl {
}
}
// 9/25/2006 ruling: If Consecrate Land enters the battlefield attached to a land thats enchanted by other Auras, those Auras are put into their owners graveyards.
// 9/25/2006 ruling: If Consecrate Land enters the battlefield attached to a land that's enchanted by other Auras, those Auras are put into their owners' graveyards.
class ConsecrateLandRuleEffect extends ContinuousRuleModifyingEffectImpl {
public ConsecrateLandRuleEffect() {

View file

@ -1,4 +1,3 @@
package mage.cards.c;
import java.util.UUID;
@ -9,7 +8,7 @@ import mage.abilities.SpellAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
@ -35,7 +34,7 @@ public final class CouncilOfTheAbsolute extends CardImpl {
this.toughness = new MageInt(4);
// As Council of the Absolute enters the battlefield, name a card other than a creature or a land card.
this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_AND_NON_CREATURE_NAME)));
this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_AND_NON_CREATURE_NAME)));
// Your opponents can't cast the chosen card.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CouncilOfTheAbsoluteReplacementEffect()));
// Spells with the chosen name cost 2 less for you to cast.
@ -58,7 +57,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec
public CouncilOfTheAbsoluteReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
staticText = "Your opponents can't cast the chosen card";
staticText = "Your opponents can't cast spells with the chosen name";
}
public CouncilOfTheAbsoluteReplacementEffect(final CouncilOfTheAbsoluteReplacementEffect effect) {
@ -79,7 +78,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
return "You can't cast a card with that name (" + mageObject.getLogName() + " in play).";
return "You can't cast a spell with that name (" + mageObject.getLogName() + " in play).";
}
return null;
}
@ -93,7 +92,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec
public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
MageObject object = game.getObject(event.getSourceId());
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) {
return true;
}
}
@ -105,7 +104,7 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl
public CouncilOfTheAbsoluteCostReductionEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
this.staticText = "Spells with the chosen name cost 2 less for you to cast";
this.staticText = "Spells with the chosen name you cast cost 2 less to cast";
}
protected CouncilOfTheAbsoluteCostReductionEffect(CouncilOfTheAbsoluteCostReductionEffect effect) {
@ -123,7 +122,7 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl
if ((abilityToModify instanceof SpellAbility)
&& abilityToModify.getControllerId().equals(source.getControllerId())) {
Card card = game.getCard(abilityToModify.getSourceId());
return card.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY));
return card.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY));
}
return false;
}

View file

@ -1,4 +1,3 @@
package mage.cards.c;
import java.util.UUID;
@ -8,7 +7,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -29,7 +28,7 @@ public final class CursedScroll extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
// {3}, {T}: Name a card. Reveal a card at random from your hand. If it's the named card, Cursed Scroll deals 2 damage to any target.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new ManaCostsImpl("{3}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{3}"));
ability.addEffect(new CursedScrollEffect());
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetAnyTarget());
@ -50,7 +49,7 @@ class CursedScrollEffect extends OneShotEffect {
public CursedScrollEffect() {
super(Outcome.Neutral);
staticText = "Reveal a card at random from your hand. If it's the named card, {this} deals 2 damage to any target";
staticText = ", then reveal a card at random from your hand. If that card has the chosen name, {this} deals 2 damage to any target";
}
public CursedScrollEffect(final CursedScrollEffect effect) {
@ -61,7 +60,7 @@ class CursedScrollEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) {
if (!controller.getHand().isEmpty()) {
Cards revealed = new CardsImpl();

View file

@ -53,7 +53,7 @@ class DacksDuplicateApplyToPermanent extends ApplyToPermanent {
@Override
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
/**
* 29/05/2014 The ability of Dacks Duplicate doesnt target the
* 29/05/2014 The ability of Dack's Duplicate doesn't target the
* creature.
*/
permanent.addAbility(new DethroneAbility(), game);

View file

@ -31,7 +31,7 @@ public final class DarksteelJuggernaut extends CardImpl {
// Indestructible
this.addAbility(IndestructibleAbility.getInstance());
// Darksteel Juggernauts power and toughness are each equal to the number of artifacts you control.
// Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL,
new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")), Duration.EndOfGame)));

View file

@ -75,13 +75,13 @@ class DawnbreakReclaimerEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
/**
* 04.11.2015 If any opponent has a creature card in their
* graveyard as Dawnbreak Reclaimers ability resolves, then you must
* choose one of those cards. You cant choose a different opponent with
* graveyard as Dawnbreak Reclaimer's ability resolves, then you must
* choose one of those cards. You can't choose a different opponent with
* no creature cards in their graveyard to avoid returning one of
* those cards.
*
* 04.11.2015 If there are no creature cards in any opponents graveyard
* as Dawnbreak Reclaimers ability resolves, youll still have the
* 04.11.2015 If there are no creature cards in any opponent's graveyard
* as Dawnbreak Reclaimer's ability resolves, you'll still have the
* option to return a creature card from your graveyard to the
* battlefield. You choose which opponent will choose a creature card in
* your graveyard.

View file

@ -6,7 +6,7 @@ import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -27,7 +27,7 @@ public final class DeclarationOfNaught extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
// As Declaration of Naught enters the battlefield, name a card.
this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL)));
this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)));
// {U}: Counter target spell with the chosen name.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}"));

View file

@ -63,7 +63,7 @@ class DeicideExileEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE
controller.moveCardToExileWithInfo(targetEnchantment, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
// 4/26/2014
// Deicide looks at the card in exile, not the permanent that was exiled, to determine
// if it is a God. For each of the Gods in the Theros block, it wont matter what your
// if it is a God. For each of the Gods in the Theros block, it won't matter what your
// devotion to its color(s) was. The card is a God card when not on the battlefield.
Card cardInExile = game.getExile().getCard(targetEnchantment.getId(), game);
if (cardInExile != null && cardInExile.hasSubtype(SubType.GOD, game)) {

View file

@ -1,4 +1,3 @@
package mage.cards.d;
import java.util.UUID;
@ -10,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MyTurnCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.cards.*;
import mage.constants.*;
@ -39,7 +38,7 @@ public final class DementiaSliver extends CardImpl {
this.toughness = new MageInt(3);
// All Slivers have "{T}: Name a card. Target opponent reveals a card at random from their hand. If it's the named card, that player discards it. Activate this ability only during your turn."
Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.instance);
Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.instance);
gainedAbility.addEffect(new DementiaSliverEffect());
gainedAbility.addTarget(new TargetOpponent());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
@ -66,7 +65,7 @@ class DementiaSliverEffect extends OneShotEffect {
public DementiaSliverEffect() {
super(Outcome.Damage);
staticText = "Target opponent reveals a card at random from their hand. If it's the named card, that player discards it";
staticText = "Target opponent reveals a card at random from their hand. If that card has the chose name, that player discards it";
}
public DementiaSliverEffect(final DementiaSliverEffect effect) {
@ -77,7 +76,7 @@ class DementiaSliverEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (opponent != null && sourceObject != null && !cardName.isEmpty()) {
if (!opponent.getHand().isEmpty()) {
Cards revealed = new CardsImpl();

View file

@ -156,7 +156,7 @@ class TargetControlledSource extends TargetSource {
return true;
}
}
// 108.4a If anything asks for the controller of a card that doesnt have one (because its not a permanent or spell), use its owner instead.
// 108.4a If anything asks for the controller of a card that doesn't have one (because it's not a permanent or spell), use its owner instead.
for (Card card : game.getExile().getAllCards(game)) {
if (Objects.equals(card.getOwnerId(), sourceControllerId)) {
count++;
@ -189,7 +189,7 @@ class TargetControlledSource extends TargetSource {
for (Card card : player.getGraveyard().getCards(game)) {
possibleTargets.add(card.getId());
}
// 108.4a If anything asks for the controller of a card that doesnt have one (because its not a permanent or spell), use its owner instead.
// 108.4a If anything asks for the controller of a card that doesn't have one (because it's not a permanent or spell), use its owner instead.
for (Card card : game.getExile().getAllCards(game)) {
if (Objects.equals(card.getOwnerId(), sourceControllerId)) {
possibleTargets.add(card.getId());

View file

@ -0,0 +1,76 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
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.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public final class DesperateResearch extends CardImpl {
public DesperateResearch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
// Choose a card name other than a basic land card name. Reveal the top seven cards of your library and put all of them with that name into your hand. Exile the rest.
this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME));
this.getSpellAbility().addEffect(new DesperateResearchEffect());
}
public DesperateResearch(final DesperateResearch card) {
super(card);
}
@Override
public DesperateResearch copy() {
return new DesperateResearch(this);
}
}
class DesperateResearchEffect extends OneShotEffect {
public DesperateResearchEffect() {
super(Outcome.Benefit);
this.staticText = "Reveal the top seven cards of your library and put all of them with that name into your hand. Exile the rest";
}
public DesperateResearchEffect(final DesperateResearchEffect effect) {
super(effect);
}
@Override
public DesperateResearchEffect copy() {
return new DesperateResearchEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
Player player = game.getPlayer(source.getControllerId());
if (player == null || cardName == null) {
return false;
}
Cards cardsToExile = new CardsImpl(player.getLibrary().getTopCards(game, 7));
player.revealCards(source, cardsToExile, game);
FilterCard filter = new FilterCard();
filter.add(new NamePredicate(cardName));
Cards cardsToKeep = new CardsImpl(cardsToExile.getCards(filter, game));
cardsToExile.removeAll(cardsToKeep);
player.moveCards(cardsToKeep, Zone.HAND, source, game);
player.moveCards(cardsToExile, Zone.EXILED, source, game);
return true;
}
}

View file

@ -3,7 +3,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -21,7 +21,7 @@ public final class Dispossess extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
// Name an artifact card. Search target player's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library.
this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.ARTIFACT_NAME)));
this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ARTIFACT_NAME)));
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new DispossessEffect());
}
@ -48,7 +48,7 @@ class DispossessEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi
@Override
public boolean apply(Game game, Ability source) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
}

View file

@ -140,7 +140,7 @@ class DrainPowerEffect extends OneShotEffect {
}
// 106.12. One card (Drain Power) causes one player to lose unspent mana and another to add the mana lost this way. (Note that these may be the same player.)
// This empties the former players mana pool and causes the mana emptied this way to be put into the latter players mana pool. Which permanents, spells, and/or
// This empties the former player's mana pool and causes the mana emptied this way to be put into the latter player's mana pool. Which permanents, spells, and/or
// abilities produced that mana are unchanged, as are any restrictions or additional effects associated with any of that mana.
List<ManaPoolItem> manaItems = targetPlayer.getManaPool().getManaItems();
targetPlayer.getManaPool().emptyPool(game);

View file

@ -102,9 +102,9 @@ class EarthshakerKhenraEffect extends OneShotEffect {
if (sourceObject != null) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
/*
27.06.2017 The target creatures power is checked when you target it with Earthshaker Khenras ability
and when that ability resolves. Once the ability resolves, if the creatures power increases
or Earthshaker Khenras power decreases, the target creature will still be unable to block.
27.06.2017 The target creature's power is checked when you target it with Earthshaker Khenra's ability
and when that ability resolves. Once the ability resolves, if the creature's power increases
or Earthshaker Khenra's power decreases, the target creature will still be unable to block.
*/
if (targetCreature != null && targetCreature.getPower().getValue() <= sourceObject.getPower().getValue()) {
ContinuousEffect effect = new CantBlockTargetEffect(Duration.EndOfTurn);

View file

@ -32,8 +32,8 @@ public final class EndlessSands extends CardImpl {
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 owners control.
ReturnCreaturesFromExileEffect returnFromExileEffect = new ReturnCreaturesFromExileEffect(this.getId(), true, "Return each creature card exiled with {this} to the battlefield under its owners control.");
// {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());

View file

@ -41,7 +41,7 @@ public final class EvilTwin extends CardImpl {
// You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature."
Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new EvilTwinApplyToPermanent());
effect.setText("a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\"");
effect.setText("as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\"");
this.addAbility(new EntersBattlefieldAbility(effect, true));
}

View file

@ -6,7 +6,7 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.AftermathAbility;
import mage.cards.CardImpl;
@ -38,7 +38,7 @@ public final class FailureComply extends SplitCard {
// Comply
// Choose a card name. Until your next turn, your opponents can't cast spells with the chosen name
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
Effect effect = new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL);
effect.setText("Choose a card name");
getRightHalfCard().getSpellAbility().addEffect(effect);
getRightHalfCard().getSpellAbility().addEffect(new ComplyCantCastEffect());
@ -74,7 +74,7 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl {
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ").";
}
return null;
@ -87,7 +87,7 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
MageObject object = game.getObject(event.getSourceId());
if (object != null && object.getName().equals(cardName)) {

View file

@ -32,14 +32,14 @@ public final class FalkenrathGorger extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
/**
* 4/8/2016 Falkenrath Gorgers ability only applies while its on the
* battlefield. If you discard it, it wont give itself madness.
* 4/8/2016 Falkenrath Gorger's ability only applies while it's on the
* battlefield. If you discard it, it won't give itself madness.
* 4/8/2016 If Falkenrath Gorger leaves the battlefield before the
* madness trigger has resolved for a Vampire card that gained madness
* with its ability, the madness ability will still let you cast that
* Vampire card for the appropriate cost even though it no longer has
* madness. 4/8/2016 If you discard a Vampire creature card that already
* has a madness ability, youll choose which madness ability exiles it.
* has a madness ability, you'll choose which madness ability exiles it.
* You may choose either the one it normally has or the one it gains
* from Falkenrath Gorger.
*/

View file

@ -156,7 +156,7 @@ class FalseOrdersUnblockEffect extends OneShotEffect {
if (chosenGroup != null) {
// Relevant ruling for Balduvian Warlord:
// 7/15/2006 If an attacking creature has an ability that triggers When this creature becomes blocked,
// it triggers when a creature blocks it due to the Warlords ability only if it was unblocked at that point.
// it triggers when a creature blocks it due to the Warlord's ability only if it was unblocked at that point.
boolean notYetBlocked = chosenGroup.getBlockers().isEmpty();
chosenGroup.addBlockerToGroup(permanent.getId(), controller.getId(), game);
game.getCombat().addBlockingGroup(permanent.getId(), chosenPermanent.getId(), controller.getId(), game); // 702.21h

View file

@ -0,0 +1,96 @@
package mage.cards.f;
import java.util.UUID;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.counter.AddCountersAttachedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author TheElk801
*/
public final class Ferocity extends CardImpl {
public Ferocity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
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);
// Whenever enchanted creature blocks or becomes blocked, you may put a +1/+1 counter on it.
this.addAbility(new FerocityTriggeredAbility());
}
public Ferocity(final Ferocity card) {
super(card);
}
@Override
public Ferocity copy() {
return new Ferocity(this);
}
}
class FerocityTriggeredAbility extends TriggeredAbilityImpl {
public FerocityTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), true);
}
public FerocityTriggeredAbility(final FerocityTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent aura = game.getPermanent(sourceId);
if (aura == null || aura.getAttachedTo() == null) {
return false;
}
if (event.getSourceId().equals(aura.getAttachedTo())) {
Permanent blocks = game.getPermanent(event.getTargetId());
return blocks != null;
}
if (event.getTargetId().equals(aura.getAttachedTo())) {
Permanent blockedBy = game.getPermanent(event.getSourceId());
return blockedBy != null;
}
return false;
}
@Override
public String getRule() {
return "Whenever enchanted creature blocks or becomes blocked, "
+ "you may put a +1/+1 counter on it";
}
@Override
public FerocityTriggeredAbility copy() {
return new FerocityTriggeredAbility(this);
}
}

View file

@ -86,6 +86,6 @@ class FertileGroundTriggeredAbility extends TriggeredManaAbility {
@Override
public String getRule() {
return "Whenever enchanted land is tapped for mana, its controller adds one mana of any color";
return "Whenever enchanted land is tapped for mana, its controller adds an additional one mana of any color.";
}
}

View file

@ -23,7 +23,7 @@ public final class FlameWave extends CardImpl {
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
this.getSpellAbility().addEffect(new DamageAllControlledTargetEffect(4, new FilterCreaturePermanent())
.setText("and each creature that player or that planeswalkers controller controls")
.setText("and each creature that player or that planeswalker's controller controls")
);
}

View file

@ -50,7 +50,7 @@ public final class ForebearsBlade extends CardImpl {
ability.addEffect(effect);
this.addAbility(ability);
// Whenever equipped creature dies, attach Forebears Blade to target creature you control.
// Whenever equipped creature dies, attach Forebear's Blade to target creature you control.
ability = new DiesAttachedTriggeredAbility(
new AttachEffect(Outcome.Neutral, "attach {this} to target creature you control"), "equipped creature", false);
ability.addTarget(new TargetControlledCreaturePermanent());

View file

@ -7,7 +7,7 @@ import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbili
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -28,7 +28,7 @@ public final class Foreshadow extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
// Choose a card name, then target opponent puts the top card of their library into their graveyard. If that card has the chosen name, you draw a card.
this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL));
this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL));
this.getSpellAbility().addEffect(new ForeshadowEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
@ -67,7 +67,7 @@ class ForeshadowEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (controller != null && targetPlayer != null && cardName != null && !cardName.isEmpty()) {
Card card = targetPlayer.getLibrary().getFromTop(game);
if (card != null) {

View file

@ -1,4 +1,3 @@
package mage.cards.g;
import java.util.UUID;
@ -121,6 +120,7 @@ class GemstoneCavernsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = game.getCard(source.getSourceId());
@ -133,13 +133,12 @@ class GemstoneCavernsEffect extends OneShotEffect {
if (permanent != null) {
Cost cost = new ExileFromHandCost(new TargetCardInHand());
if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
cost.pay(source, game, source.getSourceId(), source.getControllerId(), true, null);
result = cost.pay(source, game, source.getSourceId(), source.getControllerId(), true, null);
}
}
}
}
return true;
}
return false;
return result;
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.g;
import java.util.UUID;
@ -63,12 +62,16 @@ class GenerousPatronTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!getControllerId().equals(game.getControllerId(event.getSourceId()))) {
return false;
}
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
return event.getPlayerId().equals(this.getControllerId())
&& permanent != null
if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId());
}
return permanent != null
&& permanent.isCreature()
&& !permanent.getControllerId().equals(getControllerId())
&& event.getAmount() > 0;
&& !permanent.getControllerId().equals(getControllerId());
}
@Override

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -31,7 +31,7 @@ public final class GideonsIntervention extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
// As Gideon's Intervention enters the battlefield, choose a card name.
Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
Effect effect = new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL);
effect.setText("choose a card name");
this.addAbility(new AsEntersBattlefieldAbility(effect));
@ -72,7 +72,7 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ").";
}
return null;
@ -85,7 +85,7 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
MageObject object = game.getObject(event.getSourceId());
if (object != null && object.getName().equals(cardName)) {
@ -137,7 +137,7 @@ class GideonsInterventionPreventAllDamageEffect extends PreventionEffectImpl {
if (object != null && (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|| targetPerm != null && (event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER))) {
if (object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))
if (object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))
&& (event.getTargetId().equals(source.getControllerId())
|| targetPerm != null && targetPerm.getControllerId().equals(source.getControllerId()))) {
return super.applies(event, source, game);

View file

@ -48,7 +48,7 @@ class GoblinLyreEffect extends OneShotEffect {
public GoblinLyreEffect() {
super(Outcome.Damage);
this.staticText = "Flip a coin. If you win the flip, {this} deals damage to target opponent or planeswalker equal to the number of creatures you control. "
+ "If you lose the flip, Goblin Lyre deals damage to you equal to the number of creatures that opponent or that planeswalkers controller controls";
+ "If you lose the flip, Goblin Lyre deals damage to you equal to the number of creatures that opponent or that planeswalker's controller controls";
}
public GoblinLyreEffect(final GoblinLyreEffect effect) {

View file

@ -0,0 +1,52 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneSourceEffect;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.abilities.keyword.PartnerWithAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author L_J
*/
public final class GormTheGreat extends CardImpl {
public GormTheGreat(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GIANT);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(2);
this.toughness = new MageInt(7);
// Partner with Virtus the Veiled (When this creature enters the battlefield, target player may put Virtus into their hand from their library, then shuffle.)
this.addAbility(new PartnerWithAbility("Virtus the Veiled", true));
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Gorm the Great must be blocked if able, and Gorm must be blocked by two or more creatures if able.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAtLeastOneSourceEffect(Duration.WhileOnBattlefield, 2)
.setText("{this} must be blocked if able, and {this} must be blocked by two or more creatures if able")));
}
public GormTheGreat(final GormTheGreat card) {
super(card);
}
@Override
public GormTheGreat copy() {
return new GormTheGreat(this);
}
}

View file

@ -36,7 +36,7 @@ public final class GuardiansOfKoilos extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// When Guardians of Koilos enters the battlefield, you may return another target historic permanent you control to its owners hand.
// When Guardians of Koilos enters the battlefield, you may return another target historic permanent you control to its owner's hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandChosenControlledPermanentEffect(filter)
.setText("you may return another target historic permanent you control to its owner's hand. <i>(Artifacts, legendaries, and Sagas are historic.)</i>"), true));
}

View file

@ -93,7 +93,7 @@ class HallOfGemstoneEffect extends ReplacementEffectImpl {
if (colorChosen != null) {
ManaEvent manaEvent = (ManaEvent) event;
Mana mana = manaEvent.getMana();
// 8/23/2016 Colorless mana added to a players mana pool isnt affected.
// 8/23/2016 Colorless mana added to a player's mana pool isn't affected.
int genericAmount = mana.getGeneric();
int colorlessAmount = mana.getColorless();
int coloredAmount = mana.countColored();

View file

@ -126,7 +126,7 @@ class HaphazardBombardmentEndOfTurnEffect extends OneShotEffect {
// 4/27/2018 If one or more of the permanents with aim counters on them have indestructible,
// select the permanent destroyed at random from among the permanents with aim counters
// that dont have indestructible.
// that don't have indestructible.
FilterPermanent filter = new FilterPermanent("if two or more permanents you don't control have an aim counter on them");
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
filter.add(new CounterPredicate(CounterType.AIM));

View file

@ -77,7 +77,7 @@ class HeartOfBogardanTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() {
return "When a player doesn't pay {this}'s cumulative upkeep, "
+ "{this} deals X damage to target player or planeswalker "
+ "and each creature that player or that planeswalkers controller controls,"
+ "and each creature that player or that planeswalker's controller controls,"
+ " where X is twice the number of age counters on {this} minus 2.";
}
}
@ -87,7 +87,7 @@ class HeartOfBogardanEffect extends OneShotEffect {
public HeartOfBogardanEffect() {
super(Outcome.Damage);
staticText = "{this} deals X damage to target player or planeswalker "
+ "and each creature that player or that planeswalkers controller controls, "
+ "and each creature that player or that planeswalker's controller controls, "
+ "where X is twice the number of age counters on {this} minus 2";
}

View file

@ -78,6 +78,6 @@ class HellriderTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever a creature you control attacks, {this} deals 1 damage to the player or planeswalker its attacking.";
return "Whenever a creature you control attacks, {this} deals 1 damage to the player or planeswalker it's attacking.";
}
}

View file

@ -31,7 +31,7 @@ public final class HelmOfTheHost extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.EQUIPMENT);
// At the beginning of combat on your turn, create a token thats a copy of equipped creature, except the token isnt legendary if equipped creature is legendary. That token gains haste.
// At the beginning of combat on your turn, create a token that's a copy of equipped creature, except the token isn't legendary if equipped creature is legendary. That token gains haste.
TriggeredAbility ability = new BeginningOfCombatTriggeredAbility(
new HelmOfTheHostEffect(),
TargetController.YOU,

View file

@ -1,4 +1,3 @@
package mage.cards.i;
import java.util.UUID;
@ -17,6 +16,7 @@ import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.players.Player;
@ -37,7 +37,7 @@ public final class InfernalTutor extends CardImpl {
this.getSpellAbility().addEffect(new InfernalTutorEffect());
// Hellbent - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library.
Effect effect = new ConditionalOneShotEffect(
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCard()), false, true),
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD), false, true),
HellbentCondition.instance,
"<br/><br/><i>Hellbent</i> &mdash; If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library");
this.getSpellAbility().addEffect(effect);
@ -78,7 +78,7 @@ class InfernalTutorEffect extends OneShotEffect {
if (!controller.getHand().isEmpty()) {
Card cardToReveal = null;
if (controller.getHand().size() > 1) {
Target target = new TargetCardInHand(new FilterCard());
Target target = new TargetCardInHand(StaticFilters.FILTER_CARD);
target.setNotTarget(true);
if (controller.chooseTarget(outcome, target, source, game)) {
cardToReveal = game.getCard(target.getFirstTarget());

View file

@ -57,7 +57,7 @@ public final class InnerDemon extends CardImpl {
effect.setText(", has flying");
ability.addEffect(effect);
effect = new AddCardSubtypeAttachedEffect(SubType.DEMON, Duration.WhileOnBattlefield, AttachmentType.AURA);
effect.setText(", and is an Demon in addition to its other types");
effect.setText(", and is a Demon in addition to its other types");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
@ -41,7 +41,7 @@ public final class IsperiaTheInscrutable extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever Isperia the Inscrutable deals combat damage to a player, name a card. That player reveals their hand. If he or she reveals the named card, search your library for a creature card with flying, reveal it, put it into your hand, then shuffle your library.
Effect effect1 = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
Effect effect1 = new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL);
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(effect1, false, true);
Effect effect2 = new IsperiaTheInscrutableEffect();
ability.addEffect(effect2);
@ -69,7 +69,7 @@ class IsperiaTheInscrutableEffect extends OneShotEffect {
public IsperiaTheInscrutableEffect() {
super(Outcome.Neutral);
staticText = "That player reveals their hand. If he or she reveals the named card, search your library for a creature card with flying, reveal it, put it into your hand, then shuffle your library";
staticText = "That player reveals their hand. If a card with the chosen name is revealed this way, search your library for a creature card with flying, reveal it, put it into your hand, then shuffle your library";
}
public IsperiaTheInscrutableEffect(final IsperiaTheInscrutableEffect effect) {
@ -79,7 +79,7 @@ class IsperiaTheInscrutableEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
Object object = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
Object object = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (player != null && object instanceof String) {
player.revealCards(player.getLogName() + " hand", player.getHand(), game, true);
String namedCard = (String) object;

View file

@ -0,0 +1,89 @@
package mage.cards.i;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RevealTargetFromHandCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
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.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class IvySeer extends CardImpl {
public IvySeer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {2}{G}, {tap}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way.
Ability ability = new SimpleActivatedAbility(new IvySeerEffect(), new ManaCostsImpl("{2}{G}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public IvySeer(final IvySeer card) {
super(card);
}
@Override
public IvySeer copy() {
return new IvySeer(this);
}
}
class IvySeerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("any number of green cards in your hand");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public IvySeerEffect() {
super(Outcome.BoostCreature);
this.staticText = "reveal any number of green cards in your hand. "
+ "Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way";
}
public IvySeerEffect(final IvySeerEffect effect) {
super(effect);
}
@Override
public IvySeerEffect copy() {
return new IvySeerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
return false;
}
int xValue = cost.getNumberRevealedCards();
game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
return true;
}
}

View file

@ -0,0 +1,85 @@
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RevealTargetFromHandCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.target.common.TargetCardInHand;
/**
*
* @author TheElk801
*/
public final class JasmineSeer extends CardImpl {
public JasmineSeer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {2}{W}, {tap}: Reveal any number of white cards in your hand. You gain 2 life for each card revealed this way.
Ability ability = new SimpleActivatedAbility(new JasmineSeerEffect(), new ManaCostsImpl("{2}{W}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public JasmineSeer(final JasmineSeer card) {
super(card);
}
@Override
public JasmineSeer copy() {
return new JasmineSeer(this);
}
}
class JasmineSeerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("any number of white cards");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public JasmineSeerEffect() {
super(Outcome.GainLife);
this.staticText = "reveal any number of white cards in your hand. "
+ "You gain 2 life for each card revealed this way";
}
public JasmineSeerEffect(final JasmineSeerEffect effect) {
super(effect);
}
@Override
public JasmineSeerEffect copy() {
return new JasmineSeerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
return false;
}
int xValue = cost.getNumberRevealedCards();
return new GainLifeEffect(2 * xValue).apply(game, source);
}
}

View file

@ -24,7 +24,7 @@ public final class JayasImmolatingInferno extends CardImpl {
// (You may cast a legendary sorcery only if you control a legendary creature or planeswalker.)
this.addAbility(new LegendarySpellAbility());
// Jayas Immolating Inferno deals X damage to each of up to three targets.
// Jaya's Immolating Inferno deals X damage to each of up to three targets.
Effect effect = new DamageTargetEffect(new ManacostVariableValue());
effect.setText("{this} deals X damage to each of up to three targets");
this.getSpellAbility().addEffect(effect);

View file

@ -25,7 +25,7 @@ public final class JunglebornPioneer extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Jungleborn Pioneer enters the battlefield, create a 1/1 blue Merfolk creature token with hexproof. (It cant be the target of spells or abilities your opponents control.)
// When Jungleborn Pioneer enters the battlefield, create a 1/1 blue Merfolk creature token with hexproof. (It can't be the target of spells or abilities your opponents control.)
Ability ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MerfolkHexproofToken()),false);
this.addAbility(ability);
}

View file

@ -29,7 +29,7 @@ public final class KarnsTemporalSundering extends CardImpl {
// (You may cast a legendary sorcery only if you control a legendary creature or planeswalker.)
this.addAbility(new LegendarySpellAbility());
// Target player takes an extra turn after this one. Return up to one target nonland permanent to its owners hand. Exile Karns Temporal Sundering.
// Target player takes an extra turn after this one. Return up to one target nonland permanent to its owner's hand. Exile Karn's Temporal Sundering.
this.getSpellAbility().addEffect(new KarnsTemporalSunderingEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addTarget(new TargetNonlandPermanent(0, 1, false));
@ -50,7 +50,7 @@ class KarnsTemporalSunderingEffect extends OneShotEffect {
public KarnsTemporalSunderingEffect() {
super(Outcome.ExtraTurn);
this.staticText = "Target player takes an extra turn after this one. Return up to one target nonland permanent to its owners hand";
this.staticText = "Target player takes an extra turn after this one. Return up to one target nonland permanent to its owner's hand";
}
public KarnsTemporalSunderingEffect(final KarnsTemporalSunderingEffect effect) {

View file

@ -27,12 +27,12 @@ public final class KitesailCorsair extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Kitesail Corsair has flying as long as its attacking.
// Kitesail Corsair has flying as long as it's attacking.
ContinuousEffect gainEffect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
gainEffect,
SourceAttackingCondition.instance,
"{this} has flying as long as its attacking."
"{this} has flying as long as it's attacking."
)));
}

View file

@ -1,4 +1,3 @@
package mage.cards.k;
import java.util.UUID;
@ -28,7 +27,7 @@ public final class KrosanWayfarer extends CardImpl {
// Sacrifice Krosan Wayfarer: You may put a land card from your hand onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_BASIC_LAND_A), new SacrificeSourceCost()));
new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_LAND_A), new SacrificeSourceCost()));
}
public KrosanWayfarer(final KrosanWayfarer card) {

View file

@ -0,0 +1,89 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
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.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class KrovikanElementalist extends CardImpl {
public KrovikanElementalist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {2}{R}: Target creature gets +1/+0 until end of turn.
Ability ability = new SimpleActivatedAbility(
new BoostTargetEffect(1, 0, Duration.EndOfTurn),
new ManaCostsImpl("{2}{R}")
);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// {U}{U}: Target creature you control gains flying until end of turn. Sacrifice it at the beginning of the next end step.
ability = new SimpleActivatedAbility(new GainAbilityTargetEffect(
FlyingAbility.getInstance(),
Duration.EndOfTurn
), new ManaCostsImpl("{U}{U}"));
ability.addEffect(new KrovikanElementalistEffect());
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
}
public KrovikanElementalist(final KrovikanElementalist card) {
super(card);
}
@Override
public KrovikanElementalist copy() {
return new KrovikanElementalist(this);
}
}
class KrovikanElementalistEffect extends OneShotEffect {
public KrovikanElementalistEffect() {
super(Outcome.Sacrifice);
this.staticText = "Sacrifice it at the beginning of the next end step";
}
public KrovikanElementalistEffect(final KrovikanElementalistEffect effect) {
super(effect);
}
@Override
public KrovikanElementalistEffect copy() {
return new KrovikanElementalistEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new SacrificeTargetEffect("sacrifice it", source.getControllerId())
)).apply(game, source);
}
}

View file

@ -1,11 +1,10 @@
package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -26,7 +25,7 @@ public final class LammastideWeave extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Name a card, then target player puts the top card of their library into their graveyard. If that card is the named card, you gain life equal to its converted mana cost.
this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL));
this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL));
this.getSpellAbility().addEffect(new LammastideWeaveEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
@ -50,7 +49,7 @@ class LammastideWeaveEffect extends OneShotEffect {
public LammastideWeaveEffect() {
super(Outcome.DrawCard);
this.staticText = ", then target player puts the top card of their library into their graveyard. "
+ "If that card is the named card, you gain life equal to its converted mana cost.";
+ "If that card has the chosen name, you gain life equal to its converted mana cost.";
}
public LammastideWeaveEffect(final LammastideWeaveEffect effect) {
@ -66,7 +65,7 @@ class LammastideWeaveEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (controller != null && targetPlayer != null && cardName != null && !cardName.isEmpty()) {
Card card = targetPlayer.getLibrary().getFromTop(game);
if (card != null) {

View file

@ -51,7 +51,7 @@ class LavalancheEffect extends OneShotEffect {
public LavalancheEffect(DynamicValue amount) {
super(Outcome.Damage);
this.amount = amount;
staticText = "{this} deals X damage to target player or planeswalker and each creature that player or that planeswalkers controller controls";
staticText = "{this} deals X damage to target player or planeswalker and each creature that player or that planeswalker's controller controls";
}
public LavalancheEffect(final LavalancheEffect effect) {
@ -71,7 +71,7 @@ class LavalancheEffect extends OneShotEffect {
return false;
}
targetPlayer.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
FilterPermanent filter = new FilterPermanent("and each creature that player or that planeswalkers controller controls");
FilterPermanent filter = new FilterPermanent("and each creature that player or that planeswalker's controller controls");
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);

View file

@ -29,7 +29,7 @@ public final class LlanowarScout extends CardImpl {
// {T}: You may put a land card from your hand onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_BASIC_LAND_A), new TapSourceCost()));
new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_LAND_A), new TapSourceCost()));
}
public LlanowarScout(final LlanowarScout card) {

View file

@ -4,7 +4,7 @@ package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +25,7 @@ public final class LostLegacy extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}{B}");
// Name a nonartifact, nonland card. Search target player's graveyard, hand and library for any number of cards with that name and exile them. That player shuffles their library, then draws a card for each card exiled from hand this way.
this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_ARTIFACT_AND_NON_LAND_NAME)));
this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_ARTIFACT_AND_NON_LAND_NAME)));
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new LostLegacyEffect());
}
@ -52,7 +52,7 @@ class LostLegacyEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi
@Override
public boolean apply(Game game, Ability source) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetPlayer != null && cardName != null && !cardName.isEmpty()) {
FilterCard filter = new FilterCard();

View file

@ -47,7 +47,7 @@ class MageSlayerEffect extends OneShotEffect {
public MageSlayerEffect() {
super(Outcome.Damage);
staticText = "it deals damage equal to the player or planeswalker its attacking";
staticText = "it deals damage equal to the player or planeswalker it's attacking";
}
public MageSlayerEffect(final MageSlayerEffect effect) {

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -38,7 +38,7 @@ public final class MagusOfTheScroll extends CardImpl {
this.toughness = new MageInt(1);
// {3}, {tap}: Name a card. Reveal a card at random from your hand. If it's the named card, Magus of the Scroll deals 2 damage to any target.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new ManaCostsImpl("{3}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{3}"));
ability.addEffect(new MagusOfTheScrollEffect());
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetAnyTarget());
@ -59,7 +59,7 @@ class MagusOfTheScrollEffect extends OneShotEffect {
public MagusOfTheScrollEffect() {
super(Outcome.Neutral);
staticText = ", then reveal a card at random from your hand. If it's the named card, {this} deals 2 damage to any target";
staticText = ", then reveal a card at random from your hand. If that card has the chosen name, {this} deals 2 damage to any target";
}
public MagusOfTheScrollEffect(final MagusOfTheScrollEffect effect) {
@ -70,7 +70,7 @@ class MagusOfTheScrollEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (sourceObject != null && you != null && cardName != null && !cardName.isEmpty()) {
if (!you.getHand().isEmpty()) {
Cards revealed = new CardsImpl();

View file

@ -47,13 +47,13 @@ public final class ManorGargoyle extends CardImpl {
613.7. Within a layer or sublayer, determining which order effects are applied in is sometimes done using a dependency system.
If a dependency exists, it will override the timestamp system.
613.7a An effect is said to depend on another if
(a) its applied in the same layer (and, if applicable, sublayer) as the other effect (see rules 613.1 and 613.3);
(a) it's applied in the same layer (and, if applicable, sublayer) as the other effect (see rules 613.1 and 613.3);
(b) applying the other would change the text or the existence of the first effect, what it applies to, or what
it does to any of the things it applies to; and
(c) neither effect is from a characteristic-defining ability or both effects are from characteristic-defining
abilities. Otherwise, the effect is considered to be independent of the other effect.
613.7b An effect dependent on one or more other effects waits to apply until just after all of those effects have been applied.
If multiple dependent effects would apply simultaneously in this way, theyre applied in timestamp order relative to each
If multiple dependent effects would apply simultaneously in this way, they're applied in timestamp order relative to each
other. If several dependent effects form a dependency loop, then this rule is ignored and the effects in the dependency
loop are applied in timestamp order.
613.7c After each effect is applied, the order of remaining effects is reevaluated and may change if an effect that has not yet

View file

@ -43,9 +43,9 @@ public final class MarkOfSakiko extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature has "Whenever this creature deals combat damage to a player, add that much {G}. Until end of turn, you dont lose this mana as steps and phases end."
// Enchanted creature has "Whenever this creature deals combat damage to a player, add that much {G}. Until end of turn, you don't lose this mana as steps and phases end."
Effect effect = new GainAbilityAttachedEffect(new MarkOfSakikoTriggeredAbility(), AttachmentType.AURA);
effect.setText("Enchanted creature has \"Whenever this creature deals combat damage to a player, add that much {G}. Until end of turn, you dont lose this mana as steps and phases end.\"");
effect.setText("Enchanted creature has \"Whenever this creature deals combat damage to a player, add that much {G}. Until end of turn, you don't lose this mana as steps and phases end.\"");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
@ -87,7 +87,7 @@ class MarkOfSakikoTriggeredAbility extends TriggeredAbilityImpl {
this.getEffects().clear();
Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(event.getAmount()), "that player", true);
effect.setTargetPointer(new FixedTarget(getControllerId()));
effect.setText("add that much {G}. Until end of turn, you dont lose this mana as steps and phases end");
effect.setText("add that much {G}. Until end of turn, you don't lose this mana as steps and phases end");
this.addEffect(effect);
return true;
}
@ -98,6 +98,6 @@ class MarkOfSakikoTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever this creature deals combat damage to a player, add that much {G}. "
+ "Until end of turn, you dont lose this mana as steps and phases end.";
+ "Until end of turn, you don't lose this mana as steps and phases end.";
}
}

View file

@ -39,7 +39,7 @@ public final class MarwynTheNurturer extends CardImpl {
// Whenever another Elf enters the battlefield under your control, put a +1/+1 counter on Marwyn, the Nurturer.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter));
// {T}: Add an amount of {G} equal to Marwyns power.
// {T}: Add an amount of {G} equal to Marwyn's power.
this.addAbility(new DynamicManaAbility(Mana.GreenMana(1), new SourcePermanentPowerCount(), "Add an amount of {G} equal to {this}'s power"));
}

View file

@ -49,7 +49,7 @@ public final class MazesEnd extends CardImpl {
// {T}: Add 1.
this.addAbility(new ColorlessManaAbility());
// 3, {T}, Return Maze's End to its owners hand: Search your library for a Gate card, put it onto the battlefield, then shuffle your library. If you control ten or more Gates with different names, you win the game.
// 3, {T}, Return Maze's End to its owner's hand: Search your library for a Gate card, put it onto the battlefield, then shuffle your library. If you control ten or more Gates with different names, you win the game.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterCard)), new GenericManaCost(3));
ability.addEffect(new MazesEndEffect());
ability.addCost(new TapSourceCost());

View file

@ -22,19 +22,19 @@ import mage.players.Player;
/**
* As Meandering Towershell returns to the battlefield because of the delayed
* triggered ability, you choose which opponent or opposing planeswalker its
* attacking. It doesnt have to attack the same opponent or opposing
* triggered ability, you choose which opponent or opposing planeswalker it's
* attacking. It doesn't have to attack the same opponent or opposing
* planeswalker that it was when it was exiled.
*
* If Meandering Towershell enters the battlefield attacking, it wasnt declared
* If Meandering Towershell enters the battlefield attacking, it wasn't declared
* as an attacking creature that turn. Abilities that trigger when a creature
* attacks, including its own triggered ability, wont trigger.
* attacks, including its own triggered ability, won't trigger.
*
* On the turn Meandering Towershell attacks and is exiled, raid abilities will
* see it as a creature that attacked. Conversely, on the turn Meandering
* Towershell enters the battlefield attacking, raid abilities will not.
*
* If you attack with a Meandering Towershell that you dont own, youll control
* If you attack with a Meandering Towershell that you don't own, you'll control
* it when it returns to the battlefield.
*
* @author LevelX2

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import java.util.UUID;
@ -8,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -27,7 +26,7 @@ import mage.game.events.GameEvent.EventType;
public final class MeddlingMage extends CardImpl {
public MeddlingMage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
@ -35,7 +34,7 @@ public final class MeddlingMage extends CardImpl {
this.toughness = new MageInt(2);
// As Meddling Mage enters the battlefield, name a nonland card.
this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME)));
this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)));
//The named card can't be cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MeddlingMageReplacementEffect()));
@ -55,7 +54,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl {
public MeddlingMageReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
staticText = "The named card can't be cast";
staticText = "Spells with the chosen name can't be cast";
}
public MeddlingMageReplacementEffect(final MeddlingMageReplacementEffect effect) {
@ -76,7 +75,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl {
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
return "You can't cast a card with that name (" + mageObject.getLogName() + " in play).";
return "You can't cast a spell with that name (" + mageObject.getLogName() + " in play).";
}
return null;
}
@ -90,7 +89,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
MageObject object = game.getObject(event.getSourceId());
// fixes issue #1072
return object != null && !object.isCopy() && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY));
return object != null && !object.isCopy() && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY));
}
}

View file

@ -1,10 +1,9 @@
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -19,11 +18,11 @@ import mage.target.TargetPlayer;
public final class Memoricide extends CardImpl {
public Memoricide(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
// Name a nonland card. Search target player's graveyard, hand, and library for any number of cards with
// that name and exile them. Then that player shuffles their library
this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME)));
this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)));
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new MemoricideEffect());
}
@ -51,7 +50,7 @@ class MemoricideEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi
@Override
public boolean apply(Game game, Ability source) {
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
}
@ -62,6 +61,6 @@ class MemoricideEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi
@Override
public String getText(Mode mode) {
return "Name a nonland card. " + super.getText(mode);
return "Search target player's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library";
}
}

View file

@ -78,6 +78,6 @@ class MisersCageTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "at the beginning of each opponents upkeep, if that player has five or more cards in hand, {this} deals 2 damage to that player";
return "at the beginning of each opponent's upkeep, if that player has five or more cards in hand, {this} deals 2 damage to that player";
}
}

View file

@ -22,7 +22,7 @@ public final class MistCloakedHerald extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Mist-Cloaked Herald cant be blocked.
// Mist-Cloaked Herald can't be blocked.
this.addAbility(new CantBeBlockedSourceAbility());
}

View file

@ -115,7 +115,7 @@ class MuldrothaTheGravetideWatcher extends Watcher {
final HashMap<MageObjectReference, Set<CardType>> sourcePlayedPermanentTypes = new HashMap<>(); // source that played permanent types from graveyard
// final HashMap<UUID, Set<CardType>> playerPlayedPermanentTypes = new HashMap<>(); // player that played permanent types from graveyard
// 4/27/2018 If multiple effects allow you to play a card from your graveyard, such as those of Gisa and Geralf and Karador,
// Ghost Chieftain, you must announce which permission youre using as you begin to play the card.
// Ghost Chieftain, you must announce which permission you're using as you begin to play the card.
// 4/27/2018: If you play a card from your graveyard and then have a new Muldrotha come under your control in the same turn,
// you may play another card of that type from your graveyard that turn.
private Zone fromZone;

View file

@ -96,7 +96,7 @@ class MyrBattlesphereTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever {this} attacks, you may tap X untapped Myr you control. If you do, {this} gets +X/+0 until end of turn and deals X damage to the player or planeswalker its attacking.";
return "Whenever {this} attacks, you may tap X untapped Myr you control. If you do, {this} gets +X/+0 until end of turn and deals X damage to the player or planeswalker it's attacking.";
}
}
@ -111,7 +111,7 @@ class MyrBattlesphereEffect extends OneShotEffect {
public MyrBattlesphereEffect() {
super(Outcome.Damage);
staticText = "you may tap X untapped Myr you control. If you do, {this} gets +X/+0 until end of turn and deals X damage to the player or planeswalker its attacking.";
staticText = "you may tap X untapped Myr you control. If you do, {this} gets +X/+0 until end of turn and deals X damage to the player or planeswalker it's attacking.";
}
public MyrBattlesphereEffect(final MyrBattlesphereEffect effect) {

Some files were not shown because too many files have changed in this diff Show more