Merge pull request #36 from magefree/master

Merge https://github.com/magefree/mage
This commit is contained in:
Zzooouhh 2018-01-11 18:46:32 +01:00 committed by GitHub
commit 75d7d92774
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 4176 additions and 553 deletions

View file

@ -122,7 +122,6 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
addCard(card, bigCard, gameId, drawImage);
}
}
// System.gc();
drawCards(sortSetting);
this.setVisible(true);
}

View file

@ -301,6 +301,11 @@ public enum MythicspoilerComSource implements CardImageSource {
HashMap<String, String> linksRix = new HashMap<>();
linksRix.put("vaultofcatlacan", "vaultofcatlacan");
linksRix.put("atzalcaveofeternity", "atzalcaveofeternity");
linksRix.put("wingedtempleoforazca", "wingedtempleoforazca");
linksRix.put("metzalitoweroftriumph", "metzalitoweroftriumph");
linksRix.put("tomboftheduskrose", "tomboftheduskrose");
linksRix.put("sanctumofthesun", "sanctumofthesun");
linksRix.put("goldforgegarrison", "goldforgegarrison");
manualLinks.put("RIX", linksRix);
cardNameAliasesStart = new HashMap<>();

View file

@ -432,7 +432,12 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
throw new IllegalStateException("Second side card can't have empty name.");
}
url = new CardDownloadData(card.getSecondSideName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", "", false, card.isDoubleFaced(), true);
CardInfo secondSideCard = CardRepository.instance.findCard(card.getSecondSideName());
if (secondSideCard == null){
throw new IllegalStateException("Can''t find second side card in database: " + card.getSecondSideName());
}
url = new CardDownloadData(card.getSecondSideName(), card.getSetCode(), secondSideCard.getCardNumber(), card.usesVariousArt(), 0, "", "", false, card.isDoubleFaced(), true);
url.setType2(isType2);
allCardsUrls.add(url);
}
@ -643,7 +648,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
logger.fatal("Couldn't unmount zip files", e);
JOptionPane.showMessageDialog(null, "Couldn't unmount zip files", "Error", JOptionPane.ERROR_MESSAGE);
} finally {
System.gc();
//
}
closeButton.setText("Close");
updateCardsToDownload(jComboBoxSet.getSelectedItem().toString());

View file

@ -208,10 +208,16 @@ public final class CardImageUtils {
if (card.getUsesVariousArt()) {
finalFileName = cardName + '.' + card.getCollectorId() + ".full.jpg";
} else {
int len = card.getCollectorId().length();
if (Character.isLetter(card.getCollectorId().charAt(len - 1))) {
finalFileName = cardName + card.getCollectorId().charAt(len - 1) + ".full.jpg";
if (card.getUsesVariousArt()){
// only various arts can be same name, but different postfixes (a,b,c,d,e)
int len = card.getCollectorId().length();
if (Character.isLetter(card.getCollectorId().charAt(len - 1))) {
finalFileName = cardName + card.getCollectorId().charAt(len - 1) + ".full.jpg";
} else {
finalFileName = cardName + prefixType + ".full.jpg";
}
} else {
// normal cards with same names;
finalFileName = cardName + prefixType + ".full.jpg";
}
}

View file

@ -41,7 +41,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 = 26;
public final static String MAGE_VERSION_MINOR_PATCH = "V10";
public final static String MAGE_VERSION_MINOR_PATCH = "V11d";
public final static String MAGE_VERSION_INFO = "";
private final int major;

View file

@ -121,7 +121,7 @@ public class HumanPlayer extends PlayerImpl {
public HumanPlayer(final HumanPlayer player) {
super(player);
this.replacementEffectChoice = player.replacementEffectChoice;
this.autoSelectReplacementEffects.addAll(autoSelectReplacementEffects);
this.autoSelectReplacementEffects.addAll(player.autoSelectReplacementEffects);
this.currentlyUnpaidMana = player.currentlyUnpaidMana;
this.triggerAutoOrderAbilityFirst.addAll(player.triggerAutoOrderAbilityFirst);

View file

@ -0,0 +1,190 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class AngrathTheFlameChained extends CardImpl {
public AngrathTheFlameChained(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ANGRATH);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
// +1: Each opponent discards a card and loses 2 life.
LoyaltyAbility ability = new LoyaltyAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), 1);
ability.addEffect(new LoseLifeOpponentsEffect(2).setText("and loses 2 life"));
this.addAbility(ability);
// -3: Gain control of target creature until end of turn. Untap it. It gains haste until end of turn. Sacrifice it at the beginning of the next end step if it has converted mana cost 3 or less.
ability = new LoyaltyAbility(new GainControlTargetEffect(Duration.EndOfTurn), -3);
ability.addEffect(new UntapTargetEffect().setText("untap it"));
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn"));
ability.addEffect(new AngrathTheFlameCreateDelayedTriggerEffect());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// -8: Each opponent loses life equal to the number of cards in his or her graveyard.
this.addAbility(new LoyaltyAbility(new AngrathTheFlameUltimateEffect(), -8));
}
public AngrathTheFlameChained(final AngrathTheFlameChained card) {
super(card);
}
@Override
public AngrathTheFlameChained copy() {
return new AngrathTheFlameChained(this);
}
}
class AngrathTheFlameUltimateEffect extends OneShotEffect {
public AngrathTheFlameUltimateEffect() {
super(Outcome.Benefit);
this.staticText = "Each opponent loses life equal to the number of cards in his or her graveyard";
}
public AngrathTheFlameUltimateEffect(final AngrathTheFlameUltimateEffect effect) {
super(effect);
}
@Override
public AngrathTheFlameUltimateEffect copy() {
return new AngrathTheFlameUltimateEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(opponentId);
if (player != null && !player.getGraveyard().isEmpty()) {
player.loseLife(player.getGraveyard().size(), game, false);
}
}
return true;
}
}
class AngrathTheFlameCreateDelayedTriggerEffect extends OneShotEffect {
public AngrathTheFlameCreateDelayedTriggerEffect() {
super(Outcome.Sacrifice);
staticText = "Sacrifice it at the beginning of the next end step if it has converted mana cost 3 or less";
}
public AngrathTheFlameCreateDelayedTriggerEffect(final AngrathTheFlameCreateDelayedTriggerEffect effect) {
super(effect);
}
@Override
public AngrathTheFlameCreateDelayedTriggerEffect copy() {
return new AngrathTheFlameCreateDelayedTriggerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AngrathTheFlameChainedDelayedTriggeredAbility(sacrificeEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
}
class AngrathTheFlameChainedDelayedTriggeredAbility extends DelayedTriggeredAbility {
public AngrathTheFlameChainedDelayedTriggeredAbility(Effect effect) {
super(effect, Duration.Custom);
}
public AngrathTheFlameChainedDelayedTriggeredAbility(final AngrathTheFlameChainedDelayedTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.END_TURN_STEP_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(((FixedTarget) getEffects().get(0).getTargetPointer()).getTarget());
return permanent != null
&& permanent.getZoneChangeCounter(game) == ((FixedTarget) getEffects().get(0).getTargetPointer()).getZoneChangeCounter()
&& permanent.getConvertedManaCost() <= 3;
}
@Override
public AngrathTheFlameChainedDelayedTriggeredAbility copy() {
return new AngrathTheFlameChainedDelayedTriggeredAbility(this);
}
@Override
public String getRule() {
return "Sacrifice it at the beginning of the next end step if it has converted mana cost 3 or less.";
}
}

View file

@ -0,0 +1,80 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.MerfolkHexproofToken;
import mage.target.TargetPermanent;
/**
*
* @author L_J
*/
public class AquaticIncursion extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Merfolk");
static {
filter.add(new SubtypePredicate(SubType.MERFOLK));
}
public AquaticIncursion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
// 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.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{3}{U}"));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
public AquaticIncursion(final AquaticIncursion card) {
super(card);
}
@Override
public AquaticIncursion copy() {
return new AquaticIncursion(this);
}
}

View file

@ -0,0 +1,76 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.CitysBlessingCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.AscendAbility;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class ArchOfOrazca extends CardImpl {
public ArchOfOrazca(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// Ascend
this.addAbility(new AscendAbility());
// {t}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {5}, {T}: Draw a card. Activate this ability only if you have the city's blessing.
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
new DrawCardSourceControllerEffect(1),
new GenericManaCost(5),
CitysBlessingCondition.instance);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public ArchOfOrazca(final ArchOfOrazca card) {
super(card);
}
@Override
public ArchOfOrazca copy() {
return new ArchOfOrazca(this);
}
}

View file

@ -57,7 +57,7 @@ import mage.util.TargetAddress;
public class AuraGraft extends CardImpl {
public AuraGraft(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Gain control of target Aura that's attached to a permanent. Attach it to another permanent it can enchant.
FilterPermanent filter = new FilterPermanent("Aura that's attached to a permanent");
@ -81,7 +81,6 @@ public class AuraGraft extends CardImpl {
}
}
class AttachedToPermanentPredicate implements ObjectPlayerPredicate<ObjectPlayer<Permanent>> {
public AttachedToPermanentPredicate() {
@ -95,6 +94,7 @@ class AttachedToPermanentPredicate implements ObjectPlayerPredicate<ObjectPlayer
}
class PermanentCanBeAttachedToPredicate implements ObjectPlayerPredicate<ObjectPlayer<Permanent>> {
protected Permanent aura;
public PermanentCanBeAttachedToPredicate(Permanent aura) {
@ -102,6 +102,7 @@ class PermanentCanBeAttachedToPredicate implements ObjectPlayerPredicate<ObjectP
this.aura = aura;
}
@Override
public boolean apply(ObjectPlayer<Permanent> input, Game game) {
Permanent potentialAttachment = input.getObject();
for (TargetAddress addr : TargetAddress.walk(aura)) {
@ -130,7 +131,7 @@ class MoveTargetAuraEffect extends OneShotEffect {
}
@Override
public boolean apply(Game game, Ability source){
public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanent(targetPointer.getFirst(game, source));
if (enchantment == null) {
return false;
@ -150,10 +151,10 @@ class MoveTargetAuraEffect extends OneShotEffect {
Target target = new TargetPermanent(filter);
target.setNotTarget(true);
if (target.canChoose(oldAttachment.getId(), controller.getId(), game)
&& controller.choose(outcome, target, oldAttachment.getId(), game)) {
&& controller.choose(outcome, target, oldAttachment.getId(), game)) {
Permanent newAttachment = game.getPermanent(target.getFirstTarget());
if (newAttachment != null &&
oldAttachment.removeAttachment(enchantment.getId(), game)) {
if (newAttachment != null
&& oldAttachment.removeAttachment(enchantment.getId(), game)) {
newAttachment.addAttachment(enchantment.getId(), game);
game.informPlayers(enchantment.getLogName() + " was unattached from " + oldAttachment.getLogName() + " and attached to " + newAttachment.getLogName());
return true;

View file

@ -27,20 +27,21 @@
*/
package mage.cards.a;
import java.util.UUID;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterSpell;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.other.TargetsPermanentPredicate;
import mage.target.TargetSpell;
import java.util.UUID;
/**
*
* @author LoneFox
@ -51,7 +52,7 @@ public class AvoidFate extends CardImpl {
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new SubtypePredicate(SubType.AURA)));
filter.add(new TargetsPermanentPredicate(new FilterControlledPermanent()));
filter.add(new TargetsPermanentPredicate(StaticFilters.FILTER_CONTROLLED_PERMANENT));
}
public AvoidFate(UUID ownerId, CardSetInfo setInfo) {

View file

@ -0,0 +1,108 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.a;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class AwakenedAmalgam extends CardImpl {
public AwakenedAmalgam(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.subtype.add(SubType.GOLEM);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Awakened Amalgam's power and toughness are each equal to the number of differently named lands you control.
DynamicValue value = (new AwakenedAmalgamLandNamesCount());
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame)));
}
public AwakenedAmalgam(final AwakenedAmalgam card) {
super(card);
}
@Override
public AwakenedAmalgam copy() {
return new AwakenedAmalgam(this);
}
}
class AwakenedAmalgamLandNamesCount implements DynamicValue {
public AwakenedAmalgamLandNamesCount() {
}
public AwakenedAmalgamLandNamesCount(AwakenedAmalgamLandNamesCount dynamicValue) {
}
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
HashSet<String> landNames = new HashSet<>();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(sourceAbility.getControllerId())) {
if (permanent.isLand()) {
landNames.add(permanent.getName());
}
}
return landNames.size();
}
@Override
public AwakenedAmalgamLandNamesCount copy() {
return new AwakenedAmalgamLandNamesCount(this);
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "differently named lands you control";
}
}

View file

@ -0,0 +1,209 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2 & L_J
*/
public class AzorTheLawbringer extends CardImpl {
public AzorTheLawbringer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}{U}{U}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.SPHINX);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// 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.
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.
this.addAbility(new AttacksTriggeredAbility(new AzorTheLawbringerAttacksEffect(), false));
}
public AzorTheLawbringer(final AzorTheLawbringer card) {
super(card);
}
@Override
public AzorTheLawbringer copy() {
return new AzorTheLawbringer(this);
}
}
class AzorTheLawbringerEntersBattlefieldEffect extends OneShotEffect {
public AzorTheLawbringerEntersBattlefieldEffect() {
super(Outcome.Benefit);
this.staticText = "each opponent can't cast instant or sorcery spells during that player's next turn";
}
public AzorTheLawbringerEntersBattlefieldEffect(final AzorTheLawbringerEntersBattlefieldEffect effect) {
super(effect);
}
@Override
public AzorTheLawbringerEntersBattlefieldEffect copy() {
return new AzorTheLawbringerEntersBattlefieldEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
ContinuousEffect effect = new AzorTheLawbringerCantCastEffect();
effect.setTargetPointer(new FixedTarget(opponentId));
game.addEffect(effect, source);
}
return true;
}
}
class AzorTheLawbringerCantCastEffect extends ContinuousRuleModifyingEffectImpl {
int playersNextTurn;
public AzorTheLawbringerCantCastEffect() {
super(Duration.Custom, Outcome.Detriment);
staticText = "You can't cast instant or sorcery spells during this turn";
playersNextTurn = 0;
}
public AzorTheLawbringerCantCastEffect(final AzorTheLawbringerCantCastEffect effect) {
super(effect);
this.playersNextTurn = effect.playersNextTurn;
}
@Override
public AzorTheLawbringerCantCastEffect copy() {
return new AzorTheLawbringerCantCastEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
return "You can't cast instant or sorcery spells this turn (" + mageObject.getIdName() + ").";
}
return null;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
UUID opponentId = getTargetPointer().getFirst(game, source);
if (game.getActivePlayerId().equals(opponentId)) {
if (playersNextTurn == 0) {
playersNextTurn = game.getTurnNum();
}
if (playersNextTurn == game.getTurnNum()) {
if (opponentId.equals(event.getPlayerId())) {
MageObject object = game.getObject(event.getSourceId());
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
if (object.isInstant() || object.isSorcery()) {
return true;
}
}
}
} else {
discard();
}
} else if (playersNextTurn > 0) {
discard();
}
return false;
}
}
class AzorTheLawbringerAttacksEffect extends OneShotEffect {
AzorTheLawbringerAttacksEffect() {
super(Outcome.Benefit);
staticText = "you may pay {X}{W}{U}{U}. If you do, you gain X life and draw X cards";
}
AzorTheLawbringerAttacksEffect(final AzorTheLawbringerAttacksEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ManaCosts cost = new ManaCostsImpl("{X}{W}{U}{U}");
if (controller.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "? If you do, you gain X life and draw X cards.", source, game)) {
int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
cost.add(new GenericManaCost(costX));
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
controller.gainLife(costX, game);
controller.drawCards(costX, game);
return true;
}
}
}
return false;
}
@Override
public AzorTheLawbringerAttacksEffect copy() {
return new AzorTheLawbringerAttacksEffect(this);
}
}

View file

@ -196,8 +196,9 @@ class BaronVonCountMoveDoomCounterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
MageObject mageObject = game.getObject(source.getSourceId());
if (controller != null && mageObject != null) {
if (controller != null && sourcePermanent != null && mageObject != null) {
if (game.getState().getValue(mageObject.getId() + "_doom") == null) {
return false;
}
@ -272,8 +273,9 @@ class BaronVonCountDestroyPlayerEffect extends OneShotEffect {
game.informPlayers(targetPlayer.getLogName() + " was destroyed");
targetPlayer.lost(game); // double checks canLose, but seems more future-proof than lostForced
}
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
if (sourcePermanent != null && mageObject != null) {
if (game.getState().getValue(mageObject.getId() + "_doom") == null) {
return false;
}

View file

@ -0,0 +1,154 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class BishopOfBinding extends CardImpl {
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public BishopOfBinding(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.VAMPIRE);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// When Bishop of Binding enters the battlefield, exile target creature an opponent controls until Bishop of Binding leaves the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new BishopOfBindingExileEffect());
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(ability);
// Whenever Bishop of Binding attacks, target Vampire gets +X/+X until end of turn, where X is the power of the exiled card.
DynamicValue xVale = new BishopOfBindingExiledCardsPowerCount();
ability = new AttacksTriggeredAbility(new BoostTargetEffect(xVale, xVale, Duration.EndOfTurn, true)
.setText("target Vampire gets +X/+X until end of turn, where X is the power of the exiled card"), false);
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent(SubType.VAMPIRE, "Vampire")));
this.addAbility(ability);
}
public BishopOfBinding(final BishopOfBinding card) {
super(card);
}
@Override
public BishopOfBinding copy() {
return new BishopOfBinding(this);
}
}
class BishopOfBindingExileEffect extends OneShotEffect {
public BishopOfBindingExileEffect() {
super(Outcome.Benefit);
this.staticText = "exile target creature an opponent controls until {this} leaves the battlefield";
}
public BishopOfBindingExileEffect(final BishopOfBindingExileEffect effect) {
super(effect);
}
@Override
public BishopOfBindingExileEffect copy() {
return new BishopOfBindingExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
// If this leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source);
}
return false;
}
}
class BishopOfBindingExiledCardsPowerCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, sourceAbility.getSourceId(), sourceAbility.getSourceObjectZoneChangeCounter()));
if (exileZone != null) {
Card exiledCard = exileZone.getRandom(game);
if (exiledCard != null) {
return exiledCard.getPower().getValue();
}
}
return 0;
}
@Override
public BishopOfBindingExiledCardsPowerCount copy() {
return new BishopOfBindingExiledCardsPowerCount();
}
@Override
public String getMessage() {
return "power of the exiled card";
}
}

View file

@ -0,0 +1,123 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class BlazingHope extends CardImpl {
public BlazingHope(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
// Exile target creature with power greater than or equal to your life total.
this.getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellAbility().addTarget(new BlazingHopeTarget());
}
public BlazingHope(final BlazingHope card) {
super(card);
}
@Override
public BlazingHope copy() {
return new BlazingHope(this);
}
}
class BlazingHopeTarget extends TargetCreaturePermanent {
public BlazingHopeTarget() {
super(new FilterCreaturePermanent("creature with power greater than or equal to your life total"));
}
public BlazingHopeTarget(final BlazingHopeTarget target) {
super(target);
}
@Override
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
Permanent permanent = game.getPermanent(id);
if (permanent != null) {
if (!isNotTarget()) {
if (!permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game)
|| !permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game)) {
return false;
}
}
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && permanent.getPower().getValue() >= controller.getLife()) {
return filter.match(permanent, source.getSourceId(), controllerId, game);
}
}
return false;
}
@Override
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
int remainingTargets = this.minNumberOfTargets - targets.size();
if (remainingTargets <= 0) {
return true;
}
int count = 0;
Player controller = game.getPlayer(sourceControllerId);
MageObject targetSource = game.getObject(sourceId);
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) {
if (!targets.containsKey(permanent.getId())) {
if (notTarget || permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) {
if (controller != null && permanent.getPower().getValue() >= controller.getLife()) {
count++;
if (count >= remainingTargets) {
return true;
}
}
}
}
}
return false;
}
@Override
public BlazingHopeTarget copy() {
return new BlazingHopeTarget(this);
}
}

View file

@ -0,0 +1,125 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import java.util.Iterator;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import static mage.constants.Layer.AbilityAddingRemovingEffects_6;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class BloodSun extends CardImpl {
public BloodSun(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
// When Blood Sun enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false));
// All lands lose all abilities except mana abilities.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodSunEffect(Duration.WhileOnBattlefield)));
}
public BloodSun(final BloodSun card) {
super(card);
}
@Override
public BloodSun copy() {
return new BloodSun(this);
}
}
class BloodSunEffect extends ContinuousEffectImpl {
public BloodSunEffect(Duration duration) {
super(duration, Outcome.LoseAbility);
staticText = "all lands lose all abilities except mana abilities";
}
public BloodSunEffect(final BloodSunEffect effect) {
super(effect);
}
@Override
public BloodSunEffect copy() {
return new BloodSunEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS, player.getId(), source.getSourceId(), game)) {
switch (layer) {
case AbilityAddingRemovingEffects_6:
for (Iterator<Ability> it = permanent.getAbilities().iterator(); it.hasNext();) {
Ability ability = it.next();
if (!ability.getAbilityType().equals(AbilityType.MANA)) {
it.remove();
}
}
break;
}
}
return true;
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.AbilityAddingRemovingEffects_6;
}
}

View file

@ -0,0 +1,65 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.permanent.token.TreasureToken;
/**
*
* @author L_J
*/
public class BrazenFreebooter extends CardImpl {
public BrazenFreebooter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.PIRATE);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// When Brazen Freebooter enters the battlefield, create a colorless Treasure artifact token with "T, sacrifice this artifact: Add one mana of any color to your mana pool."
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new TreasureToken()), false));
}
public BrazenFreebooter(final BrazenFreebooter card) {
super(card);
}
@Override
public BrazenFreebooter copy() {
return new BrazenFreebooter(this);
}
}

View file

@ -0,0 +1,110 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.Game;
import mage.target.targetpointer.FixedTarget;
import static mage.constants.Outcome.Benefit;
/**
*
* @author mpouedras
*/
public class BroodOfCockroaches extends CardImpl {
public BroodOfCockroaches(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.INSECT);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// When Brood of Cockroaches is put into your graveyard from the battlefield,
// at the beginning of the next end step,
// you lose 1 life
// and return Brood of Cockroaches to your hand.
this.addAbility(new DiesTriggeredAbility(new BroodOfCockroachesEffect()));
}
public BroodOfCockroaches(final BroodOfCockroaches card) {
super(card);
}
@Override
public BroodOfCockroaches copy() {
return new BroodOfCockroaches(this);
}
}
class BroodOfCockroachesEffect extends OneShotEffect {
private static final String effectText = "at the beginning of the next end step, you lose 1 life and return Brood of Cockroaches to your hand.";
BroodOfCockroachesEffect() {
super(Benefit);
staticText = effectText;
}
BroodOfCockroachesEffect(BroodOfCockroachesEffect broodOfCockroachesEffect) {
super(broodOfCockroachesEffect);
}
@Override
public boolean apply(Game game, Ability source) {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedLifeLost =
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new LoseLifeSourceControllerEffect(1));
game.addDelayedTriggeredAbility(delayedLifeLost, source);
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return {this} to your hand.");
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
@Override
public Effect copy() {
return new BroodOfCockroachesEffect(this);
}
}

View file

@ -0,0 +1,82 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author L_J
*/
public class BuccaneersBravado extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Pirate");
static {
filter.add(new SubtypePredicate(SubType.PIRATE));
}
public BuccaneersBravado(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
// Choose one -
// Target creature gets +1/+1 and gains first strike until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn).setText("Target creature gets +1/+1"));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn).setText("and gains first strike until end of turn"));
// Target Pirate gets +1/+1 and gains double strike until end of turn.
Mode mode = new Mode();
mode.getTargets().add(new TargetPermanent(filter));
mode.getEffects().add(new BoostTargetEffect(1, 1, Duration.EndOfTurn).setText("Target Pirate gets +1/+1"));
mode.getEffects().add(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn).setText("and gains double strike until end of turn"));
this.getSpellAbility().addMode(mode);
}
public BuccaneersBravado(final BuccaneersBravado card) {
super(card);
}
@Override
public BuccaneersBravado copy() {
return new BuccaneersBravado(this);
}
}

View file

@ -27,10 +27,10 @@
*/
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
@ -41,27 +41,31 @@ import mage.constants.SubType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import java.util.UUID;
/**
*
* @author L_J
*/
public class ChampionOfDusk extends CardImpl {
private static FilterControlledPermanent filter = new FilterControlledPermanent("Vampires you control");
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Vampires you control");
static {
filter.add(new SubtypePredicate(SubType.VAMPIRE));
}
public ChampionOfDusk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add(SubType.VAMPIRE);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// When Champion of Dusk enters the battlefield, you draw X cards and you lose X life, where X is the number of Vampires you control.
Ability ability = new EntersBattlefieldAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filter)));
ability.addEffect(new LoseLifeSourceControllerEffect(new PermanentsOnBattlefieldCount(filter)));
DynamicValue xCount = new PermanentsOnBattlefieldCount(filter);
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(xCount));
ability.addEffect(new LoseLifeSourceControllerEffect(xCount));
this.addAbility(ability);
}

View file

@ -33,19 +33,15 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashAllEffect;
import mage.cards.Card;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
@ -94,8 +90,22 @@ public class CherishedHatchling extends CardImpl {
class CherishedHatchlingTriggeredAbility extends DelayedTriggeredAbility {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public CherishedHatchlingTriggeredAbility() {
super(new CherishedHatchlingGainAbilityEffect(), Duration.EndOfTurn, true);
super(getEffectToAdd(), Duration.EndOfTurn, true);
}
private static Effect getEffectToAdd() {
Ability abilityToAdd = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect().setText("you may have it fight another target creature"), true);
abilityToAdd.addTarget(new TargetCreaturePermanent(filter));
Effect effect = new GainAbilityTargetEffect(abilityToAdd, Duration.EndOfTurn,
"it gains \"When this creature enters the battlefield, you may have it fight another target creature.\"", true);
return effect;
}
private CherishedHatchlingTriggeredAbility(final CherishedHatchlingTriggeredAbility ability) {
@ -117,7 +127,7 @@ class CherishedHatchlingTriggeredAbility extends DelayedTriggeredAbility {
if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.isCreature() && spell.hasSubtype(SubType.DINOSAUR, game)) {
getEffects().setTargetPointer(new FixedTarget(spell.getId()));
getEffects().setTargetPointer(new FixedTarget(spell.getSourceId()));
return true;
}
}
@ -130,47 +140,47 @@ class CherishedHatchlingTriggeredAbility extends DelayedTriggeredAbility {
}
}
class CherishedHatchlingGainAbilityEffect extends ContinuousEffectImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
private Ability abilityToAdd = null;
private Card relatedCard = null;
public CherishedHatchlingGainAbilityEffect() {
super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
staticText = "it gains \"When this creature enters the battlefield, you may have it fight another target creature.\"";
}
public CherishedHatchlingGainAbilityEffect(final CherishedHatchlingGainAbilityEffect effect) {
super(effect);
this.abilityToAdd = effect.abilityToAdd;
this.relatedCard = effect.relatedCard;
}
@Override
public CherishedHatchlingGainAbilityEffect copy() {
return new CherishedHatchlingGainAbilityEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
if (relatedCard == null) {
Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
if (spell != null) {
relatedCard = game.getCard(spell.getSourceId());
Effect effect = new FightTargetSourceEffect();
effect.setText("you may have it fight another target creature");
abilityToAdd = new EntersBattlefieldTriggeredAbility(effect, true);
abilityToAdd.addTarget(new TargetCreaturePermanent(filter));
}
}
if (relatedCard != null) {
game.getState().addOtherAbility(relatedCard, abilityToAdd, false);
}
return true;
}
}
//class CherishedHatchlingGainAbilityEffect extends ContinuousEffectImpl {
//
// private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
//
// static {
// filter.add(new AnotherPredicate());
// }
// private Ability abilityToAdd = null;
// private Card relatedCard = null;
//
// public CherishedHatchlingGainAbilityEffect() {
// super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
// staticText = "it gains \"When this creature enters the battlefield, you may have it fight another target creature.\"";
// }
//
// public CherishedHatchlingGainAbilityEffect(final CherishedHatchlingGainAbilityEffect effect) {
// super(effect);
// this.abilityToAdd = effect.abilityToAdd;
// this.relatedCard = effect.relatedCard;
// }
//
// @Override
// public CherishedHatchlingGainAbilityEffect copy() {
// return new CherishedHatchlingGainAbilityEffect(this);
// }
//
// @Override
// public boolean apply(Game game, Ability source) {
// if (relatedCard == null) {
// Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
// if (spell != null) {
// relatedCard = game.getCard(spell.getSourceId());
// Effect effect = new FightTargetSourceEffect();
// effect.setText("you may have it fight another target creature");
// abilityToAdd = new EntersBattlefieldTriggeredAbility(effect, true);
// abilityToAdd.addTarget(new TargetCreaturePermanent(filter));
// }
// }
// if (relatedCard != null) {
// game.getState().addOtherAbility(relatedCard, abilityToAdd, false);
// }
// return true;
// }
//}

View file

@ -0,0 +1,135 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.common.RollDiceEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author spjspj
*/
public class ChickenALaKing extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Chicken you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
filter.add(new SubtypePredicate(SubType.CHICKEN));
}
public ChickenALaKing(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
this.subtype.add(SubType.CHICKEN);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever a 6 is rolled on a six-sided die, put a +1/+1 counter on each Chicken.
this.addAbility(new ChickenALaKingTriggeredAbility());
// Tap an untapped Chicken you control: Roll a six-sided die.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(null, Outcome.Benefit, 6), new TapTargetCost(new TargetControlledPermanent(1, 1, filter, false))));
}
public ChickenALaKing(final ChickenALaKing card) {
super(card);
}
@Override
public ChickenALaKing copy() {
return new ChickenALaKing(this);
}
}
class ChickenALaKingTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each Chicken");
static {
filter.add(new SubtypePredicate(SubType.CHICKEN));
}
public ChickenALaKingTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter));
}
public ChickenALaKingTriggeredAbility(final ChickenALaKingTriggeredAbility ability) {
super(ability);
}
@Override
public ChickenALaKingTriggeredAbility copy() {
return new ChickenALaKingTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DICE_ROLLED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) {
// event.getData holds the num of sides of the die to roll
String data = event.getData();
if (data != null) {
int numSides = Integer.parseInt(data);
if (event.getAmount() == 6 && numSides == 6) {
return true;
}
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a 6 is rolled on a six-sided die, put a +1/+1 counter on each Chicken";
}
}

View file

@ -0,0 +1,104 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.c;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.game.permanent.token.GiantChickenToken;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author ciaccona007
*/
public class ChickenEgg extends CardImpl {
public ChickenEgg(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add(SubType.EGG);
this.power = new MageInt(0);
this.toughness = new MageInt(1);
// At the beginning of your upkeep, roll a six-sided die. If you roll a 6, sacrifice Chicken Egg and create a 4/4 red Giant Chicken creature token.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ChickenEggEffect(), TargetController.YOU, false));
}
public ChickenEgg(final ChickenEgg card) {
super(card);
}
@Override
public ChickenEgg copy() {
return new ChickenEgg(this);
}
}
class ChickenEggEffect extends OneShotEffect {
ChickenEggEffect() {
super(Outcome.Benefit);
this.staticText = "roll a six-sided die. If you roll a 6, sacrifice {this} and create a 4/4 red Giant Chicken creature token";
}
ChickenEggEffect(final ChickenEggEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int result = controller.rollDice(game, 6);
if (result == 6) {
new SacrificeSourceEffect().apply(game, source);
return (new CreateTokenEffect(new GiantChickenToken(), 1)).apply(game, source);
}
}
return false;
}
@Override
public ChickenEggEffect copy() {
return new ChickenEggEffect(this);
}
}

View file

@ -182,7 +182,14 @@ class ChromeMoxManaEffect extends ManaEffect {
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
player.choose(outcome, choice, game);
while (!player.choose(outcome, choice, game)) {
if (!player.canRespond()) {
return false;
}
}
if (choice.getChoice() == null) {
return false;
}
}
switch (choice.getChoice()) {
case "Black":

View file

@ -27,7 +27,6 @@
*/
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.SuspendedCondition;
@ -46,14 +45,17 @@ import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledPermanent;
import java.util.Objects;
import java.util.UUID;
/**
*
* @author anonymous
@ -84,8 +86,6 @@ public class CurseOfTheCabal extends CardImpl {
class CurseOfTheCabalSacrificeEffect extends OneShotEffect {
private static final FilterControlledPermanent FILTER = new FilterControlledPermanent(); // ggf filter.FilterPermanent
public CurseOfTheCabalSacrificeEffect() {
super(Outcome.Sacrifice);
this.staticText = "Target player sacrifices half the permanents he or she controls, rounded down.";
@ -104,21 +104,20 @@ class CurseOfTheCabalSacrificeEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (targetPlayer != null) {
int amount = game.getBattlefield().countAll(FILTER, targetPlayer.getId(), game) / 2;
int amount = game.getBattlefield().countAll(StaticFilters.FILTER_CONTROLLED_PERMANENT, targetPlayer.getId(), game) / 2;
if (amount < 1) {
return true;
}
Target target = new TargetControlledPermanent(amount, amount, FILTER, true);
Target target = new TargetControlledPermanent(amount, amount, StaticFilters.FILTER_CONTROLLED_PERMANENT, true);
if (target.canChoose(targetPlayer.getId(), game)) {
while (!target.isChosen() && target.canChoose(targetPlayer.getId(), game) && targetPlayer.canRespond()) {
targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
}
for (int idx = 0; idx < target.getTargets().size(); idx++) {
Permanent permanent = game.getPermanent(target.getTargets().get(idx));
if (permanent != null) {
permanent.sacrifice(source.getSourceId(), game);
}
}
//sacrifice all chosen (non null) permanents
target.getTargets().stream()
.map(game::getPermanent)
.filter(Objects::nonNull)
.forEach(permanent -> permanent.sacrifice(source.getSourceId(), game));
}
return true;
}

View file

@ -122,7 +122,7 @@ class DeadMansChestEffect extends OneShotEffect {
Player owner = game.getPlayer(attachedTo.getOwnerId());
int amount = attachedTo.getPower().getValue();
if (owner != null && amount > 0) {
Set<Card> cards = controller.getLibrary().getTopCards(game, amount);
Set<Card> cards = owner.getLibrary().getTopCards(game, amount);
if (!cards.isEmpty()) {
controller.moveCardsToExile(cards, source, game, true, source.getSourceId(), sourceObject.getLogName());
for (Card card : cards) {

View file

@ -0,0 +1,92 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
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.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author spjspj
*/
public class FowlPlay extends CardImpl {
public FowlPlay(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature is a Chicken with base power and toughness 1/1 and loses all abilities.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BecomesCreatureAttachedEffect(new FowlPlayToken(),
"Enchanted creature is a Chicken with base power and toughness 1/1 and loses all abilities",
Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.ABILITIES_SUBTYPE_AND_PT)));
}
public FowlPlay(final FowlPlay card) {
super(card);
}
@Override
public FowlPlay copy() {
return new FowlPlay(this);
}
}
class FowlPlayToken extends Token {
public FowlPlayToken() {
super("Chicken", "a Chicken with base power and toughness 1/1 with no abilities");
cardType.add(CardType.CREATURE);
subtype.add(SubType.CHICKEN);
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -0,0 +1,125 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.common.FilterArtifactCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterEnchantmentCard;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author spjspj
*/
public class GoblinTutor extends CardImpl {
public GoblinTutor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// Roll a six-sided die. If you roll a 1, Goblin Tutor has no effect. Otherwise, search your library for the indicated card, reveal it, put it into your hand, then shuffle your library. 2 - A card named Goblin Tutor 3 - An enchantment card 4 - An artifact card 5 - A creature card 6 - An instant or sorcery card
this.getSpellAbility().addEffect(new GoblinTutorEffect());
}
public GoblinTutor(final GoblinTutor card) {
super(card);
}
@Override
public GoblinTutor copy() {
return new GoblinTutor(this);
}
}
class GoblinTutorEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("card named Goblin Tutor");
static {
filter.add(new NamePredicate("Goblin Tutor"));
}
public GoblinTutorEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Roll a six-sided die. If you roll a 1, {this} has no effect. Otherwise, search your library for the indicated card, reveal it, put it into your hand, then shuffle your library. 2 - A card named Goblin Tutor 3 - An enchantment card 4 - An artifact card 5 - A creature card 6 - An instant or sorcery card";
}
public GoblinTutorEffect(final GoblinTutorEffect effect) {
super(effect);
}
@Override
public GoblinTutorEffect copy() {
return new GoblinTutorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int amount = controller.rollDice(game, 6);
Effect effect = null;
// 2 - A card named Goblin Tutor
// 3 - An enchantment card
// 4 - An artifact card
// 5 - A creature card
// 6 - An instant or sorcery card
if (amount == 2) {
effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true);
} else if (amount == 3) {
effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterEnchantmentCard()), true);
} else if (amount == 4) {
effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterArtifactCard()), true);
} else if (amount == 5) {
effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterCreatureCard()), true);
} else if (amount == 6) {
effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterInstantOrSorceryCard()), true);
}
if (effect != null) {
effect.apply(game, source);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,99 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.g;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author ciaccona007
*/
public class GrowthSpurt extends CardImpl {
public GrowthSpurt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new GrowthSpurtEffect());
}
public GrowthSpurt(final GrowthSpurt card) {
super(card);
}
@Override
public GrowthSpurt copy() {
return new GrowthSpurt(this);
}
}
class GrowthSpurtEffect extends OneShotEffect {
GrowthSpurtEffect() {
super(Outcome.BoostCreature);
this.staticText = "todo"; //TODO
}
GrowthSpurtEffect(final GrowthSpurtEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int result = controller.rollDice(game, 6);
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(result, result, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
}
return false;
}
public GrowthSpurtEffect copy() {
return new GrowthSpurtEffect(this);
}
}

View file

@ -44,7 +44,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
public class GruesomeFate extends CardImpl {
public GruesomeFate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{5}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
// Each opponent loses 1 life for each creature you control.
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control");

View file

@ -0,0 +1,116 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author spjspj
*/
public class HungryHungryHeifer extends CardImpl {
public HungryHungryHeifer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.subtype.add(SubType.COW);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of your upkeep, you may remove a counter from a permanent you control. If you don't, sacrifice Hungry Hungry Heifer.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new HungryHungryHeiferEffect(), TargetController.YOU, false, false));
}
public HungryHungryHeifer(final HungryHungryHeifer card) {
super(card);
}
@Override
public HungryHungryHeifer copy() {
return new HungryHungryHeifer(this);
}
}
class HungryHungryHeiferEffect extends OneShotEffect {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a permanent you control with a counter on it");
static {
filter.add(new CounterPredicate(null));
}
public HungryHungryHeiferEffect() {
super(Outcome.Sacrifice);
this.staticText = "you may remove a counter from a permanent you control. If you don't, sacrifice {this}";
}
public HungryHungryHeiferEffect(final HungryHungryHeiferEffect effect) {
super(effect);
}
@Override
public HungryHungryHeiferEffect copy() {
return new HungryHungryHeiferEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game);
if (sourceObject != null && controller != null) {
if (controller.chooseUse(outcome, "Remove a counter from a permanent you control?", source, game)) {
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true);
RemoveCounterCost cost = new RemoveCounterCost(target);
if (cost.pay(null, game, source.getSourceId(), controller.getId(), true)) {
return true;
}
}
sourceObject.sacrifice(source.getSourceId(), game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,121 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.i;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
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.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author spjspj
*/
public class Incoming extends CardImpl {
public Incoming(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}{G}{G}");
// Each player searches his or her library for any number of artifact, creature, enchantment, and/or land cards, puts them onto the battlefield, then shuffles his or her library.
this.getSpellAbility().addEffect(new IncomingEffect());
}
public Incoming(final Incoming card) {
super(card);
}
@Override
public Incoming copy() {
return new Incoming(this);
}
}
class IncomingEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("artifact, creature, enchantment, and/or land cards");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.LAND)));
}
public IncomingEffect() {
super(Outcome.Detriment);
this.staticText = "Each player searches his or her library for any number of artifact, creature, enchantment, and/or land cards, puts them onto the battlefield, then shuffles his or her library";
}
public IncomingEffect(final IncomingEffect effect) {
super(effect);
}
@Override
public IncomingEffect copy() {
return new IncomingEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, filter);
if (player.searchLibrary(target, game)) {
for (UUID cardId : target.getTargets()) {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId(), true);
}
}
player.shuffleLibrary(source, game);
}
}
}
// prevent undo
controller.resetStoredBookmark(game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,110 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.i;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author L_J
*/
public class IndenturedDjinn extends CardImpl {
public IndenturedDjinn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
this.subtype.add(SubType.DJINN);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Indentured Djinn enters the battlefield, each other player may draw up to three cards.
this.addAbility(new EntersBattlefieldTriggeredAbility(new IndenturedDjinnEffect(), false));
}
public IndenturedDjinn(final IndenturedDjinn card) {
super(card);
}
@Override
public IndenturedDjinn copy() {
return new IndenturedDjinn(this);
}
}
class IndenturedDjinnEffect extends OneShotEffect {
IndenturedDjinnEffect() {
super(Outcome.DrawCard);
this.staticText = "each other player may draw up to three cards";
}
IndenturedDjinnEffect(final IndenturedDjinnEffect effect) {
super(effect);
}
@Override
public IndenturedDjinnEffect copy() {
return new IndenturedDjinnEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);
if (player != null) {
Effect effect = new DrawCardTargetEffect(new StaticValue(3), false, true);
effect.setTargetPointer(new FixedTarget(playerId));
effect.setText(player.getLogName() + " may draw up to three cards");
effect.apply(game, source);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,119 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.j;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author spjspj
*/
public class JackInTheMox extends CardImpl {
public JackInTheMox(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{0}");
// {T}: Roll a six-sided die. This ability has the indicated effect.
// 1 - Sacrifice Jack-in-the-Mox and you lose 5 life.
// 2 - Add {W} to your mana pool.
// 3 - Add {U} to your mana pool.
// 4 - Add {B} to your mana pool.
// 5 - Add {R} to your mana pool.
// 6 - Add {G} to your mana pool.
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new JackInTheMoxManaEffect(), new TapSourceCost());
this.addAbility(ability);
}
public JackInTheMox(final JackInTheMox card) {
super(card);
}
@Override
public JackInTheMox copy() {
return new JackInTheMox(this);
}
}
class JackInTheMoxManaEffect extends ManaEffect {
JackInTheMoxManaEffect() {
super();
staticText = "Roll a six-sided die. If result is 1 - Sacrifice {this} and you lose 5 life. 2 - Add {W} 3 - Add {U} 4 - Add {B} 5 - Add {R} 6 - Add {G} to your mana pool";
}
JackInTheMoxManaEffect(final JackInTheMoxManaEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(game, 6);
if (amount == 1) {
permanent.sacrifice(source.getSourceId(), game);
controller.loseLife(5, game, false);
} else if (amount == 2) {
controller.getManaPool().addMana(Mana.WhiteMana(1), game, source);
} else if (amount == 3) {
controller.getManaPool().addMana(Mana.BlueMana(1), game, source);
} else if (amount == 4) {
controller.getManaPool().addMana(Mana.BlackMana(1), game, source);
} else if (amount == 5) {
controller.getManaPool().addMana(Mana.RedMana(1), game, source);
} else if (amount == 6) {
controller.getManaPool().addMana(Mana.GreenMana(1), game, source);
}
return true;
}
return false;
}
@Override
public JackInTheMoxManaEffect copy() {
return new JackInTheMoxManaEffect(this);
}
@Override
public Mana getMana(Game game, Ability source) {
return null;
}
}

View file

@ -0,0 +1,177 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.j;
import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author spjspj
*/
public class JumboImp extends CardImpl {
public JumboImp(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.IMP);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Flying
this.addAbility(FlyingAbility.getInstance());
// As Jumbo Imp enters the battlefield, roll a six-sided die. Jumbo Imp enters the battlefield with a number of +1/+1 counters on it equal to the result.
this.addAbility(new EntersBattlefieldAbility(new JumboImpEffect(new Counter("P1P1"))));
// At the beginning of your upkeep, roll a six-sided die and put a number of +1/+1 counters on Jumbo Imp equal to the result.
Ability ability2 = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new JumboImpAddCountersEffect(), TargetController.YOU, false);
this.addAbility(ability2);
// At the beginning of your end step, roll a six-sided die and remove a number of +1/+1 counters from Jumbo Imp equal to the result.
Ability ability3 = new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new JumboImpRemoveCountersEffect(), TargetController.YOU, null, false);
this.addAbility(ability3);
}
public JumboImp(final JumboImp card) {
super(card);
}
@Override
public JumboImp copy() {
return new JumboImp(this);
}
}
class JumboImpEffect extends EntersBattlefieldWithXCountersEffect {
public JumboImpEffect(Counter counter) {
super(counter);
}
public JumboImpEffect(EntersBattlefieldWithXCountersEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentEntering(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(game, 6);
ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appldiedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
return super.apply(game, source);
}
return false;
}
@Override
public EntersBattlefieldWithXCountersEffect copy() {
return new JumboImpEffect(this);
}
}
class JumboImpAddCountersEffect extends OneShotEffect {
public JumboImpAddCountersEffect() {
super(Outcome.Benefit);
this.staticText = "roll a six-sided die and put a number of +1/+1 counters on {this} equal to the result";
}
public JumboImpAddCountersEffect(final JumboImpAddCountersEffect effect) {
super(effect);
}
@Override
public JumboImpAddCountersEffect copy() {
return new JumboImpAddCountersEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(game, 6);
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
return true;
}
return false;
}
}
class JumboImpRemoveCountersEffect extends OneShotEffect {
public JumboImpRemoveCountersEffect() {
super(Outcome.Detriment);
this.staticText = "roll a six-sided die and remove a number of +1/+1 counters on {this} equal to the result";
}
public JumboImpRemoveCountersEffect(final JumboImpRemoveCountersEffect effect) {
super(effect);
}
@Override
public JumboImpRemoveCountersEffect copy() {
return new JumboImpRemoveCountersEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(game, 6);
permanent.removeCounters(CounterType.P1P1.createInstance(amount), game);
return true;
}
return false;
}
}

View file

@ -34,10 +34,10 @@ import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbil
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
@ -57,7 +57,7 @@ public class KindredCharge extends CardImpl {
public KindredCharge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}{R}");
// Choose a creature type. For each creature you control of the chosen type, create a token that's a copy of that creature.
// Choose a creature type. For each creature you control of the chosen type, create a token that's a copy of that creature.
// Those tokens gain haste. Exile them at the beginning of the next end step.
this.getSpellAbility().addEffect(new ChooseCreatureTypeEffect(Outcome.Copy));
this.getSpellAbility().addEffect(new KindredChargeEffect());
@ -95,7 +95,11 @@ class KindredChargeEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
String creatureType = game.getState().getValue(sourceObject.getId() + "_type").toString();
Object object = game.getState().getValue(sourceObject.getId() + "_type");
if (object == null) {
return false;
}
String creatureType = object.toString();
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type");
filter.add(new SubtypePredicate(SubType.byDescription(creatureType)));
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {

View file

@ -34,9 +34,9 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
@ -48,6 +48,7 @@ import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author Saga
@ -55,10 +56,10 @@ import mage.players.Player;
public class KindredSummons extends CardImpl {
public KindredSummons(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{5}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{G}{G}");
// Choose a creature type. Reveal cards from the top of your library until you reveal X creature cards of the chosen type,
// where X is the number of creatures you control of that type. Put those cards onto the battlefield,
// Choose a creature type. Reveal cards from the top of your library until you reveal X creature cards of the chosen type,
// where X is the number of creatures you control of that type. Put those cards onto the battlefield,
// then shuffle the rest of the revealed cards into your library.
this.getSpellAbility().addEffect(new ChooseCreatureTypeEffect(Outcome.PutCreatureInPlay));
this.getSpellAbility().addEffect(new KindredSummonsEffect());
@ -78,8 +79,8 @@ class KindredSummonsEffect extends OneShotEffect {
public KindredSummonsEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Reveal cards from the top of your library until you reveal X creature cards of the chosen type, " +
"where X is the number of creatures you control of that type. Put those cards onto the battlefield, "
this.staticText = "Reveal cards from the top of your library until you reveal X creature cards of the chosen type, "
+ "where X is the number of creatures you control of that type. Put those cards onto the battlefield, "
+ "then shuffle the rest of the revealed cards into your library";
}
@ -97,7 +98,11 @@ class KindredSummonsEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
String creatureType = game.getState().getValue(sourceObject.getId() + "_type").toString();
Object object = game.getState().getValue(sourceObject.getId() + "_type");
if (object == null) {
return false;
}
String creatureType = object.toString();
FilterControlledCreaturePermanent filterPermanent = new FilterControlledCreaturePermanent("creature you control of the chosen type");
filterPermanent.add(new SubtypePredicate(SubType.byDescription(creatureType)));
int numberOfCards = game.getBattlefield().countAll(filterPermanent, source.getControllerId(), game);

View file

@ -0,0 +1,102 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.k;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageEverythingEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author ciaccona007
*/
public class KrazyKow extends CardImpl {
public KrazyKow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add(SubType.COW);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of your upkeep, roll a six-sided die. If you a roll a 1, sacrifice Krazy Kow and it deals 3 damage to each creature and each player.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new KrazyKowEffect(), TargetController.YOU, false));
}
public KrazyKow(final KrazyKow card) {
super(card);
}
@Override
public KrazyKow copy() {
return new KrazyKow(this);
}
}
class KrazyKowEffect extends OneShotEffect {
KrazyKowEffect() {
super(Outcome.Benefit);
this.staticText = "roll a six-sided die. If you roll a 1, sacrifice {this} and it deals 3 damage to each creature and each player";
}
KrazyKowEffect(final KrazyKowEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int result = controller.rollDice(game, 6);
if (result == 1) {
new SacrificeSourceEffect().apply(game, source);
return new DamageEverythingEffect(3).apply(game, source);
}
}
return false;
}
@Override
public KrazyKowEffect copy() {
return new KrazyKowEffect(this);
}
}

View file

@ -55,19 +55,19 @@ import mage.target.common.TargetControlledPermanent;
*/
public class KumenaTyrantOfOrazca extends CardImpl {
private static final FilterControlledPermanent filterAnother = new FilterControlledPermanent("another untapped Merfolk you control");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Merfolk you control");
private static final FilterControlledPermanent filterAnotherNotTapped = new FilterControlledPermanent("another untapped Merfolk you control");
private static final FilterControlledPermanent filterNotTapped = new FilterControlledPermanent("untapped Merfolk you control");
private static final FilterControlledPermanent filterAll = new FilterControlledPermanent("Merfolk you control");
static {
filterAnother.add(new AnotherPredicate());
filterAnother.add(new SubtypePredicate(SubType.MERFOLK));
filterAnother.add(Predicates.not(new TappedPredicate()));
filterAnotherNotTapped.add(new AnotherPredicate());
filterAnotherNotTapped.add(new SubtypePredicate(SubType.MERFOLK));
filterAnotherNotTapped.add(Predicates.not(new TappedPredicate()));
filter.add(new SubtypePredicate(SubType.MERFOLK));
filter.add(Predicates.not(new TappedPredicate()));
filterNotTapped.add(new SubtypePredicate(SubType.MERFOLK));
filterNotTapped.add(Predicates.not(new TappedPredicate()));
filter.add(new SubtypePredicate(SubType.MERFOLK));
filterAll.add(new SubtypePredicate(SubType.MERFOLK));
}
public KumenaTyrantOfOrazca(UUID ownerId, CardSetInfo setInfo) {
@ -82,17 +82,17 @@ public class KumenaTyrantOfOrazca extends CardImpl {
// Tap another untapped Merfolk you control: Kumena, Tyrant of Orzca can't be blocked this turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CantBeBlockedSourceEffect(Duration.EndOfTurn),
new TapTargetCost(new TargetControlledPermanent(1, 1, filterAnother, true))));
new TapTargetCost(new TargetControlledPermanent(1, 1, filterAnotherNotTapped, true))));
// Tap three untapped Merfolk you control: Draw a card.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new DrawCardSourceControllerEffect(1),
new TapTargetCost(new TargetControlledPermanent(3, 3, filter, true))));
new TapTargetCost(new TargetControlledPermanent(3, 3, filterNotTapped, true))));
// Tap five untapped Merfolk you control: Put a +1/+1 counter on each Merfolk you control.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new AddCountersAllEffect(CounterType.P1P1.createInstance(), filterAll),
new TapTargetCost(new TargetControlledPermanent(5, 5, filter, true))));
new TapTargetCost(new TargetControlledPermanent(5, 5, filterNotTapped, true))));
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
@ -37,26 +36,19 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public class MakeshiftMunitions extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact or creature");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE)
));
}
public MakeshiftMunitions(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
@ -65,7 +57,7 @@ public class MakeshiftMunitions extends CardImpl {
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new DamageTargetEffect(1),
new SacrificeTargetCost(new TargetControlledPermanent(filter))
new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE))
);
ability.addTarget(new TargetCreatureOrPlayer());
ability.addCost(new GenericManaCost(1));

View file

@ -39,8 +39,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -57,10 +57,9 @@ import mage.target.common.TargetLandPermanent;
public class MarketFestival extends CardImpl {
public MarketFestival(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
this.subtype.add(SubType.AURA);
// Enchant land
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
@ -108,14 +107,12 @@ class MarketFestivalTriggeredAbility extends TriggeredManaAbility {
return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
@Override
public String getRule() {
return "Whenever enchanted land is tapped for mana, its controller adds two mana in any combination of colors to his or her mana pool <i>(in addition to the mana the land produces)</i>.";
}
}
class MarketFestivalManaEffect extends ManaEffect {
public MarketFestivalManaEffect() {
@ -152,7 +149,9 @@ class MarketFestivalManaEffect extends ManaEffect {
return false;
}
}
if (choiceColor.getChoice() == null) { // Possible after reconnect?
return false;
}
choiceColor.increaseMana(mana);
}
checkToFirePossibleEvents(mana, game, source);

View file

@ -126,9 +126,11 @@ class MetzaliTowerOfTriumphEffect extends OneShotEffect {
available.add(permanent);
}
}
Permanent permanent = available.get(RandomUtil.nextInt(available.size()));
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
if (!available.isEmpty()) {
Permanent permanent = available.get(RandomUtil.nextInt(available.size()));
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
}
return true;
}

View file

@ -27,6 +27,7 @@
*/
package mage.cards.n;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
@ -52,10 +53,6 @@ import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.LinkedHashSet;
import java.util.UUID;
import java.util.stream.Collectors;
/**
*
* @author LevelX2
@ -124,7 +121,7 @@ class NewBloodEffect extends OneShotEffect {
class ChangeCreatureTypeTargetEffect extends ContinuousEffectImpl {
private SubType fromSubType;
private SubType toSubType;
private final SubType toSubType;
public ChangeCreatureTypeTargetEffect(SubType fromSubType, SubType toSubType, Duration duration) {
super(duration, Layer.TextChangingEffects_3, SubLayer.NA, Outcome.Benefit);
@ -153,6 +150,7 @@ class ChangeCreatureTypeTargetEffect extends ContinuousEffectImpl {
}
}
if (typeChoice.getChoice() == null) {
discard();
return;
}
fromSubType = SubType.byDescription(typeChoice.getChoice());

View file

@ -91,6 +91,7 @@ class OathswornVampirePlayEffect extends AsThoughEffectImpl {
public OathswornVampirePlayEffect(final OathswornVampirePlayEffect effect) {
super(effect);
this.condition = effect.condition;
}
@Override

View file

@ -58,8 +58,7 @@ import mage.target.targetpointer.FixedTarget;
public class OrderOfSuccession extends CardImpl {
public OrderOfSuccession(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}");
// Choose left or right. Starting with you and proceeding in the chosen direction, each player chooses a creature controlled by the next player in that direction. Each player gains control of the creature he or she chose.
this.getSpellAbility().addEffect(new OrderOfSuccessionEffect());
@ -98,7 +97,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
Map<UUID, UUID> playerCreature = new HashMap<>(2);
Choice choice = new ChoiceLeftOrRight();
controller.choose(Outcome.Neutral, choice, game);
boolean left = choice.getChoice().equals("Left");
boolean left = choice == null || choice.getChoice().equals("Left"); // to prevent npe
PlayerList playerList = game.getState().getPlayerList().copy();
// set playerlist to controller
while (!playerList.get().equals(source.getControllerId()) && controller.canRespond()) {
@ -108,7 +107,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
Player nextPlayer;
UUID firstNextPlayer = null;
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()){
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()) {
nextPlayer = game.getPlayer(playerList.get());
if (nextPlayer == null) {
return false;

View file

@ -0,0 +1,74 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.CantAttackBlockAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.NamePredicate;
/**
*
* @author spjspj
*/
public class PaperTiger extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures named Rock Lobster");
static {
filter.add(new NamePredicate("Rock Lobster"));
}
public PaperTiger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.subtype.add(SubType.CAT);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Creatures named Rock Lobster can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAllEffect(Duration.WhileOnBattlefield, filter)));
}
public PaperTiger(final PaperTiger card) {
super(card);
}
@Override
public PaperTiger copy() {
return new PaperTiger(this);
}
}

View file

@ -46,7 +46,7 @@ public class PiratesPillage extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
// As an additional cost to cast Pirate's Pillage, discard a card.
this.getSpellAbility().addCost(new DiscardCardCost(true));
this.getSpellAbility().addCost(new DiscardCardCost(false));
// Draw two cards and create two colorless Treasure artifacts with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool."
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));

View file

@ -0,0 +1,111 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.p;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author ciaccona007
*/
public class Poultrygeist extends CardImpl {
public Poultrygeist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
this.subtype.add(SubType.CHICKEN);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dies, you may roll a six-sided die. If you roll a 1, sacrifice Poultrygeist. Otherwise, put a +1/+1 counter on Poultrygeist.
Ability ability = new DiesCreatureTriggeredAbility(new PoultrygeistEffect(), true);
this.addAbility(ability);
}
public Poultrygeist(final Poultrygeist card) {
super(card);
}
@Override
public Poultrygeist copy() {
return new Poultrygeist(this);
}
}
class PoultrygeistEffect extends OneShotEffect {
PoultrygeistEffect() {
super(Outcome.BoostCreature);
this.staticText = "roll a six-sided die. If you roll a 1, sacrifice {this}. Otherwise, put a +1/+1 counter on {this}";
}
PoultrygeistEffect(final PoultrygeistEffect ability) {
super(ability);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int result = controller.rollDice(game, 6);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if (result == 1) {
return permanent.sacrifice(source.getSourceId(), game);
} else {
return new AddCountersSourceEffect(CounterType.P1P1.createInstance()).apply(game, source);
}
}
}
return false;
}
@Override
public PoultrygeistEffect copy() {
return new PoultrygeistEffect(this);
}
}

View file

@ -31,7 +31,6 @@ import java.util.UUID;
import mage.abilities.condition.common.CitysBlessingCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.keyword.AscendEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -52,7 +51,7 @@ public class PrideOfConquerors extends CardImpl {
// Creatures you control get +1/+1 until end of turn. If you have the city's blessing, those creatures get +2/+2 until end of turn instead.
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn),
new BoostTargetEffect(1, 1, Duration.EndOfTurn), CitysBlessingCondition.instance,
new BoostControlledEffect(1, 1, Duration.EndOfTurn), CitysBlessingCondition.instance,
"Creatures you control get +1/+1 until end of turn. If you have the city's blessing, those creatures get +2/+2 until end of turn instead"));
}

View file

@ -105,7 +105,7 @@ class ProfaneProcessionEffect extends OneShotEffect {
new ExileTargetEffect(exileId, sourceObject.getIdName()).setTargetPointer(targetPointer).apply(game, source);
game.applyEffects();
ExileZone exileZone = game.getExile().getExileZone(exileId);
if (exileZone.size() > 2) {
if (exileZone != null && exileZone.size() > 2) {
new TransformSourceEffect(true).apply(game, source);
}
return true;

View file

@ -31,7 +31,6 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -55,7 +54,7 @@ public class Prohibit extends CardImpl {
this.addAbility(new KickerAbility("{2}"));
// Counter target spell if its converted mana cost is 2 or less. If Prohibit was kicked, counter that spell if its converted mana cost is 4 or less instead.
this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addEffect(new ProhibitEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
@ -69,20 +68,20 @@ public class Prohibit extends CardImpl {
}
}
class OverloadEffect extends OneShotEffect {
class ProhibitEffect extends OneShotEffect {
OverloadEffect() {
ProhibitEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Counter target spell if its converted mana cost is 2 or less. If {this} was kicked, counter that spell if its converted mana cost is 4 or less instead.";
}
OverloadEffect(final OverloadEffect effect) {
ProhibitEffect(final ProhibitEffect effect) {
super(effect);
}
@Override
public OverloadEffect copy() {
return new OverloadEffect(this);
public ProhibitEffect copy() {
return new ProhibitEffect(this);
}
@Override

View file

@ -47,11 +47,11 @@ public class RagingRegisaur extends CardImpl {
public RagingRegisaur(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
this.subtype.add(SubType.DINOSAUR);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Raging Regisaur attacks, it deals 1 damage to target creature or player.
Ability ability = new AttacksTriggeredAbility(new DamageTargetEffect(1), false, "it deals 1 damage to target creature or player");
Ability ability = new AttacksTriggeredAbility(new DamageTargetEffect(1, "it"), false);
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}

View file

@ -27,42 +27,16 @@
*/
package mage.cards.r;
import java.io.ObjectStreamException;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.VariableManaCost;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.*;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WingmateRocToken;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import mage.watchers.common.PlayerAttackedWatcher;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
/**
* @author JayDi85
@ -73,9 +47,14 @@ public class RecklessRage extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// Reckless Rage deals 4 damage to target creature you dont control and 2 damage to target creature you control.
this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent());
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you dont control");
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new DamageTargetEffect(4).setUseOnlyTargetPointer(true));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(RecklessRageEffect.getInstance());
this.getSpellAbility().addEffect(new DamageTargetEffect(2).setUseOnlyTargetPointer(true)
.setText("and 2 damage to target creature you control")
.setTargetPointer(new SecondTargetPointer()));
}
public RecklessRage(final RecklessRage card) {
@ -87,49 +66,3 @@ public class RecklessRage extends CardImpl {
return new RecklessRage(this);
}
}
class RecklessRageEffect extends OneShotEffect {
private static final RecklessRageEffect instance = new RecklessRageEffect();
private Object readResolve() throws ObjectStreamException {
return instance;
}
public static RecklessRageEffect getInstance() {
return instance;
}
private RecklessRageEffect ( ) {
super(Outcome.Damage);
staticText = "{source} deals 4 damage to target creature you dont control and 2 damage to target creature you control.";
}
@Override
public boolean apply(Game game, Ability source) {
boolean completed = false;
int stepNumber = 1;
for ( Target target : source.getTargets() ) {
if (stepNumber > 2) {
System.out.println("ERROR: " + RecklessRage.class.toString() + " got too many targets (need 2, got " + source.getTargets().size() + ")");
break;
}
Permanent permanent = game.getPermanent(target.getFirstTarget());
if(permanent != null){
completed |= (permanent.damage( (stepNumber == 1) ? 2 : 4, source.getSourceId(), game, false, true ) > 0);
}
stepNumber = stepNumber + 1;
}
return completed;
}
@Override
public Effect copy() {
return instance;
}
}

View file

@ -50,41 +50,41 @@ import mage.target.targetpointer.FixedTarget;
*
* @author LevelX2
*/
public class ReturnToTheWind extends CardImpl {
public class ReleaseToTheWind extends CardImpl {
public ReturnToTheWind(UUID ownerId, CardSetInfo setInfo) {
public ReleaseToTheWind(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
// Exile target nonland permanent. For as long as that card remains exiled, its owner may cast it without paying its mana cost.
getSpellAbility().addEffect(new ReturnToTheWindEffect());
getSpellAbility().addEffect(new ReleaseToTheWindEffect());
getSpellAbility().addTarget(new TargetNonlandPermanent());
}
public ReturnToTheWind(final ReturnToTheWind card) {
public ReleaseToTheWind(final ReleaseToTheWind card) {
super(card);
}
@Override
public ReturnToTheWind copy() {
return new ReturnToTheWind(this);
public ReleaseToTheWind copy() {
return new ReleaseToTheWind(this);
}
}
class ReturnToTheWindEffect extends OneShotEffect {
class ReleaseToTheWindEffect extends OneShotEffect {
public ReturnToTheWindEffect() {
public ReleaseToTheWindEffect() {
super(Outcome.Benefit);
this.staticText = "Exile target nonland permanent. For as long as that card remains exiled, its owner may cast it without paying its mana cost";
}
public ReturnToTheWindEffect(final ReturnToTheWindEffect effect) {
public ReleaseToTheWindEffect(final ReleaseToTheWindEffect effect) {
super(effect);
}
@Override
public ReturnToTheWindEffect copy() {
return new ReturnToTheWindEffect(this);
public ReleaseToTheWindEffect copy() {
return new ReleaseToTheWindEffect(this);
}
@Override
@ -96,7 +96,7 @@ class ReturnToTheWindEffect extends OneShotEffect {
if (controller.moveCards(targetPermanent, Zone.EXILED, source, game)) {
Card card = game.getCard(targetPermanent.getId());
if (card != null) {
ContinuousEffect effect = new ReturnToTheWindEffectCastFromExileEffect();
ContinuousEffect effect = new ReleaseToTheWindEffectCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
game.addEffect(effect, source);
}
@ -108,14 +108,14 @@ class ReturnToTheWindEffect extends OneShotEffect {
}
}
class ReturnToTheWindEffectCastFromExileEffect extends AsThoughEffectImpl {
class ReleaseToTheWindEffectCastFromExileEffect extends AsThoughEffectImpl {
public ReturnToTheWindEffectCastFromExileEffect() {
public ReleaseToTheWindEffectCastFromExileEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit);
staticText = "For as long as that card remains exiled, its owner may cast it without paying its mana cost";
}
public ReturnToTheWindEffectCastFromExileEffect(final ReturnToTheWindEffectCastFromExileEffect effect) {
public ReleaseToTheWindEffectCastFromExileEffect(final ReleaseToTheWindEffectCastFromExileEffect effect) {
super(effect);
}
@ -125,8 +125,8 @@ class ReturnToTheWindEffectCastFromExileEffect extends AsThoughEffectImpl {
}
@Override
public ReturnToTheWindEffectCastFromExileEffect copy() {
return new ReturnToTheWindEffectCastFromExileEffect(this);
public ReleaseToTheWindEffectCastFromExileEffect copy() {
return new ReleaseToTheWindEffectCastFromExileEffect(this);
}
@Override

View file

@ -28,6 +28,7 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
@ -57,13 +58,6 @@ import mage.target.common.TargetCardInLibrary;
*/
public class Remembrance extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature you control");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(Predicates.not(new TokenPredicate()));
}
public Remembrance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
@ -83,8 +77,15 @@ public class Remembrance extends CardImpl {
class RemembranceTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature you control");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(Predicates.not(new TokenPredicate()));
}
public RemembranceTriggeredAbility() {
super(Zone.BATTLEFIELD, null);
super(Zone.BATTLEFIELD, new RemembranceEffect());
this.optional = true;
}
@ -107,9 +108,10 @@ class RemembranceTriggeredAbility extends TriggeredAbilityImpl {
if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) {
this.getEffects().clear();
this.addEffect(new RemembranceEffect(permanent.getName()));
MageObject mageObject = game.getObject(sourceId);
if (permanent != null
&& filter.match(permanent, game)) {
game.getState().setValue(mageObject + "nameOfPermanent", permanent.getName());
return true;
}
}
@ -126,9 +128,8 @@ class RemembranceEffect extends OneShotEffect {
private String cardName;
RemembranceEffect(String cardName) {
RemembranceEffect() {
super(Outcome.Benefit);
this.cardName = cardName;
}
RemembranceEffect(final RemembranceEffect effect) {
@ -143,7 +144,10 @@ class RemembranceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
MageObject mageObject = game.getObject(source.getSourceId());
cardName = (String) game.getState().getValue(mageObject + "nameOfPermanent");
if (controller != null
&& cardName != null) {
FilterCard filterCard = new FilterCard("card named " + cardName);
filterCard.add(new NamePredicate(cardName));
return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source);

View file

@ -68,8 +68,8 @@ public class RimefeatherOwl extends CardImpl {
private static final FilterPermanent filter2 = new FilterPermanent("snow permanents on the battlefield");
static {
filter.add(Predicates.not(new CounterPredicate(CounterType.ICE)));
filter2.add(Predicates.not(new SupertypePredicate(SuperType.SNOW)));
filter.add(new CounterPredicate(CounterType.ICE));
filter2.add(new SupertypePredicate(SuperType.SNOW));
}
public RimefeatherOwl(UUID ownerId, CardSetInfo setInfo) {

View file

@ -0,0 +1,74 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.CantAttackBlockAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.NamePredicate;
/**
*
* @author spjspj
*/
public class RockLobster extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures named Scissors Lizard");
static {
filter.add(new NamePredicate("Scissors Lizard"));
}
public RockLobster(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.subtype.add(SubType.LOBSTER);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Creatures named Scissors Lizard can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAllEffect(Duration.WhileOnBattlefield, filter)));
}
public RockLobster(final RockLobster card) {
super(card);
}
@Override
public RockLobster copy() {
return new RockLobster(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.CantAttackBlockAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.NamePredicate;
/**
*
* @author spjspj
*/
public class ScissorsLizard extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures named Paper Tiger");
static {
filter.add(new NamePredicate("Paper Tiger"));
}
public ScissorsLizard(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.subtype.add(SubType.LIZARD);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Creatures named Paper Tiger can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAllEffect(Duration.WhileOnBattlefield, filter)));
}
public ScissorsLizard(final ScissorsLizard card) {
super(card);
}
@Override
public ScissorsLizard copy() {
return new ScissorsLizard(this);
}
}

View file

@ -1,67 +1,67 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.condition.common.CitysBlessingCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.abilities.effects.keyword.AscendEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author LevelX2
*/
public class SecretsOfTheGoldenCity extends CardImpl {
public SecretsOfTheGoldenCity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{U}");
// Ascend
this.getSpellAbility().addEffect(new AscendEffect());
// Draw two cards. If you have the city's blessing, draw three cards instead.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DiscardControllerEffect(3),
new DiscardControllerEffect(2),
CitysBlessingCondition.instance,
"Draw two cards. If you have the city's blessing, draw three cards instead"));
}
public SecretsOfTheGoldenCity(final SecretsOfTheGoldenCity card) {
super(card);
}
@Override
public SecretsOfTheGoldenCity copy() {
return new SecretsOfTheGoldenCity(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.condition.common.CitysBlessingCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.keyword.AscendEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author LevelX2
*/
public class SecretsOfTheGoldenCity extends CardImpl {
public SecretsOfTheGoldenCity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{U}");
// Ascend
this.getSpellAbility().addEffect(new AscendEffect());
// Draw two cards. If you have the city's blessing, draw three cards instead.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(3),
new DrawCardSourceControllerEffect(2),
CitysBlessingCondition.instance,
"Draw two cards. If you have the city's blessing, draw three cards instead"));
}
public SecretsOfTheGoldenCity(final SecretsOfTheGoldenCity card) {
super(card);
}
@Override
public SecretsOfTheGoldenCity copy() {
return new SecretsOfTheGoldenCity(this);
}
}

View file

@ -52,6 +52,7 @@ import mage.constants.TargetController;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
@ -82,7 +83,7 @@ public class SeeRed extends CardImpl {
this.addAbility(new ConditionalTriggeredAbility(
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU),
new InvertCondition(ControllerAttackedThisTurnCondition.instance),
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."));
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."), new AttackedThisTurnWatcher());
}
public SeeRed(final SeeRed card) {

View file

@ -102,6 +102,7 @@ class TempleAltisaurPreventEffect extends PreventionEffectImpl {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null
&& !permanent.getId().equals(source.getSourceId())
&& permanent.hasSubtype(SubType.DINOSAUR, game)
&& permanent.getControllerId().equals(source.getControllerId())) {
return super.applies(event, source, game);
}

View file

@ -0,0 +1,118 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.WinGameSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
/**
*
* @author spjspj
*/
public class TheCheeseStandsAlone extends CardImpl {
public TheCheeseStandsAlone(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}{W}");
// When you control no permanents other than The Cheese Stands Alone and have no cards in hand, you win the game.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new CheeseStandsAloneContinuousEffect());
this.addAbility(ability);
}
public TheCheeseStandsAlone(final TheCheeseStandsAlone card) {
super(card);
}
@Override
public TheCheeseStandsAlone copy() {
return new TheCheeseStandsAlone(this);
}
}
class CheeseStandsAloneContinuousEffect extends ContinuousRuleModifyingEffectImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent();
private boolean wonAlready = false;
static {
filter.add(new NamePredicate("The Cheese Stands Alone"));
}
public CheeseStandsAloneContinuousEffect() {
super(Duration.EndOfGame, Outcome.Benefit, false, false);
staticText = "When you control no permanents other than {this} and have no cards in hand, you win the game";
}
public CheeseStandsAloneContinuousEffect(final CheeseStandsAloneContinuousEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.getHand().isEmpty()) {
int numberPerms = new PermanentsOnBattlefieldCount(new FilterControlledPermanent()).calculate(game, source, this);
if (numberPerms == 1) {
if (game.getBattlefield().contains(filter, source.getControllerId(), 1, game)) {
if (!wonAlready) {
wonAlready = true;
controller.won(game);
}
}
}
}
}
return false;
}
@Override
public CheeseStandsAloneContinuousEffect copy() {
return new CheeseStandsAloneContinuousEffect(this);
}
}

View file

@ -52,9 +52,9 @@ import mage.target.common.TargetCreaturePermanent;
*
* @author LevelX2
*/
public class TilonalisCrown extends CardImpl {
public class TilonallisCrown extends CardImpl {
public TilonalisCrown(UUID ownerId, CardSetInfo setInfo) {
public TilonallisCrown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
this.subtype.add(SubType.AURA);
@ -66,7 +66,7 @@ public class TilonalisCrown extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When Tilonali's Crown enters the battlefield, it deals 1 damage to enchanted creature.
// When Tilonalli's Crown enters the battlefield, it deals 1 damage to enchanted creature.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DamageAttachedEffect(1, "it")
.setText("it deals 1 damage to enchanted creature")));
@ -78,12 +78,12 @@ public class TilonalisCrown extends CardImpl {
this.addAbility(ability);
}
public TilonalisCrown(final TilonalisCrown card) {
public TilonallisCrown(final TilonallisCrown card) {
super(card);
}
@Override
public TilonalisCrown copy() {
return new TilonalisCrown(this);
public TilonallisCrown copy() {
return new TilonallisCrown(this);
}
}

View file

@ -0,0 +1,76 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import java.util.UUID;
/**
*
* @author ciaccona007
*/
public class TimmyPowerGamer extends CardImpl {
public TimmyPowerGamer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.GAMER);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {4}: You may put a creature card from your hand onto the battlefield.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PutPermanentOnBattlefieldEffect(new FilterCreatureCard("a creature card")),
new ManaCostsImpl("{4}"));
this.addAbility(ability);
}
public TimmyPowerGamer(final TimmyPowerGamer card) {
super(card);
}
@Override
public TimmyPowerGamer copy() {
return new TimmyPowerGamer(this);
}
}

View file

@ -0,0 +1,91 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.CompoundCondition;
import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.condition.common.OnOpponentsTurnCondition;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.PhaseStep;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.TargetPermanent;
/**
*
* @author L_J
*/
public class TradeCaravan extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("basic land");
static {
filter.add(new SupertypePredicate(SuperType.BASIC));
}
public TradeCaravan(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.NOMAD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// At the beginning of your upkeep, put a currency counter on Trade Caravan.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CURRENCY.createInstance()), TargetController.YOU, false));
// Remove two currency counters from Trade Caravan: Untap target basic land. Activate this ability only during an opponent's upkeep.
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new RemoveCountersSourceCost(CounterType.CURRENCY.createInstance(2)),
new CompoundCondition(OnOpponentsTurnCondition.instance, new IsStepCondition(PhaseStep.UPKEEP, false)),
"Remove two currency counters from {this}: Untap target basic land. Activate this ability only during an opponent's upkeep.");
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
public TradeCaravan(final TradeCaravan card) {
super(card);
}
@Override
public TradeCaravan copy() {
return new TradeCaravan(this);
}
}

View file

@ -0,0 +1,95 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author L_J
*/
public class Truce extends CardImpl {
public Truce(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
// Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life.
this.getSpellAbility().addEffect(new TruceEffect());
}
public Truce(final Truce card) {
super(card);
}
@Override
public Truce copy() {
return new Truce(this);
}
}
class TruceEffect extends OneShotEffect {
TruceEffect() {
super(Outcome.DrawCard);
this.staticText = "Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life";
}
TruceEffect(final TruceEffect effect) {
super(effect);
}
@Override
public TruceEffect copy() {
return new TruceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
int cardsToDraw = player.getAmount(0, 2, "Draw how many cards?", game);
player.drawCards(cardsToDraw, game);
player.gainLife((2 - cardsToDraw) * 2, game);
}
}
return true;
}
return false;
}
}

View file

@ -63,7 +63,7 @@ public class VoraciousVampire extends CardImpl {
// When Voracious Vampire enters the battlefield, target Vampire you control gets +1/+1 and gains menace until end of turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(1, 1, Duration.EndOfTurn), false);
Effect effect = new GainAbilityTargetEffect(new MenaceAbility(), Duration.EndOfTurn);
effect.setText("and gains menace");
effect.setText("and gains menace until end of turn.");
ability.addEffect(effect);
ability.addTarget(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent(SubType.VAMPIRE, "Vampire you control")));
this.addAbility(ability);

View file

@ -1,100 +1,98 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class WarkiteMarauder extends CardImpl {
private final UUID originalId;
public WarkiteMarauder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.PIRATE);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn.
Ability ability = new AttacksTriggeredAbility(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)
.setText("target creature defending player controls loses all abilities"), false);
ability.addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)
.setText("and has base power and toughness 0/1 until end of turn"));
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
this.addAbility(ability);
this.originalId = ability.getOriginalId();
}
public WarkiteMarauder(final WarkiteMarauder card) {
super(card);
this.originalId = card.originalId;
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getOriginalId().equals(originalId)) {
ability.getTargets().clear();
ability.addTarget(new TargetControlledCreaturePermanent());
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
ability.addTarget(target);
}
}
@Override
public WarkiteMarauder copy() {
return new WarkiteMarauder(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class WarkiteMarauder extends CardImpl {
private final UUID originalId;
public WarkiteMarauder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.PIRATE);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn.
Ability ability = new AttacksTriggeredAbility(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)
.setText("target creature defending player controls loses all abilities"), false);
ability.addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)
.setText("and has base power and toughness 0/1 until end of turn"));
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
this.addAbility(ability);
this.originalId = ability.getOriginalId();
}
public WarkiteMarauder(final WarkiteMarauder card) {
super(card);
this.originalId = card.originalId;
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getOriginalId().equals(originalId)) {
ability.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(1, 1, filter, false);
ability.addTarget(target);
}
}
@Override
public WarkiteMarauder copy() {
return new WarkiteMarauder(this);
}
}

View file

@ -119,7 +119,7 @@ public class ArabianNights extends ExpansionSet {
cards.add(new SetCardInfo("Mijae Djinn", 51, Rarity.RARE, mage.cards.m.MijaeDjinn.class));
cards.add(new SetCardInfo("Moorish Cavalry", 62, Rarity.COMMON, mage.cards.m.MoorishCavalry.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Moorish Cavalry", 63, Rarity.COMMON, mage.cards.m.MoorishCavalry.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mountain", 91, Rarity.COMMON, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mountain", 91, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Nafs Asp", 36, Rarity.COMMON, NafsAsp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Nafs Asp", 37, Rarity.COMMON, NafsAsp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Oasis", 92, Rarity.UNCOMMON, mage.cards.o.Oasis.class));

View file

@ -170,11 +170,11 @@ public class Coldsnap extends ExpansionSet {
cards.add(new SetCardInfo("Sheltering Ancient", 121, Rarity.UNCOMMON, mage.cards.s.ShelteringAncient.class));
cards.add(new SetCardInfo("Simian Brawler", 122, Rarity.COMMON, mage.cards.s.SimianBrawler.class));
cards.add(new SetCardInfo("Skred", 97, Rarity.COMMON, mage.cards.s.Skred.class));
cards.add(new SetCardInfo("Snow-Covered Forest", 155, Rarity.COMMON, mage.cards.s.SnowCoveredForest.class));
cards.add(new SetCardInfo("Snow-Covered Island", 152, Rarity.COMMON, mage.cards.s.SnowCoveredIsland.class));
cards.add(new SetCardInfo("Snow-Covered Mountain", 154, Rarity.COMMON, mage.cards.s.SnowCoveredMountain.class));
cards.add(new SetCardInfo("Snow-Covered Plains", 151, Rarity.COMMON, mage.cards.s.SnowCoveredPlains.class));
cards.add(new SetCardInfo("Snow-Covered Swamp", 153, Rarity.COMMON, mage.cards.s.SnowCoveredSwamp.class));
cards.add(new SetCardInfo("Snow-Covered Forest", 155, Rarity.LAND, mage.cards.s.SnowCoveredForest.class));
cards.add(new SetCardInfo("Snow-Covered Island", 152, Rarity.LAND, mage.cards.s.SnowCoveredIsland.class));
cards.add(new SetCardInfo("Snow-Covered Mountain", 154, Rarity.LAND, mage.cards.s.SnowCoveredMountain.class));
cards.add(new SetCardInfo("Snow-Covered Plains", 151, Rarity.LAND, mage.cards.s.SnowCoveredPlains.class));
cards.add(new SetCardInfo("Snow-Covered Swamp", 153, Rarity.LAND, mage.cards.s.SnowCoveredSwamp.class));
cards.add(new SetCardInfo("Soul Spike", 70, Rarity.RARE, mage.cards.s.SoulSpike.class));
cards.add(new SetCardInfo("Sound the Call", 123, Rarity.COMMON, mage.cards.s.SoundTheCall.class));
cards.add(new SetCardInfo("Squall Drifter", 17, Rarity.COMMON, mage.cards.s.SquallDrifter.class));

View file

@ -411,6 +411,7 @@ public class FifthEdition extends ExpansionSet {
cards.add(new SetCardInfo("Torture", 61, Rarity.COMMON, Torture.class));
cards.add(new SetCardInfo("Touch of Death", 62, Rarity.COMMON, mage.cards.t.TouchOfDeath.class));
cards.add(new SetCardInfo("Tranquility", 195, Rarity.COMMON, mage.cards.t.Tranquility.class));
cards.add(new SetCardInfo("Truce", 341, Rarity.RARE, mage.cards.t.Truce.class));
cards.add(new SetCardInfo("Tsunami", 196, Rarity.UNCOMMON, mage.cards.t.Tsunami.class));
cards.add(new SetCardInfo("Tundra Wolves", 342, Rarity.COMMON, mage.cards.t.TundraWolves.class));
cards.add(new SetCardInfo("Twiddle", 130, Rarity.COMMON, mage.cards.t.Twiddle.class));

View file

@ -45,8 +45,8 @@ public class HasconPromo2017 extends ExpansionSet {
private HasconPromo2017() {
super("HASCON Promo 2017", "H17", ExpansionSet.buildDate(2017, 9, 8), SetType.JOKESET);
cards.add(new ExpansionSet.SetCardInfo("Grimlock, Dinobot Leader", 1, Rarity.MYTHIC, mage.cards.g.GrimlockDinobotLeader.class));
cards.add(new ExpansionSet.SetCardInfo("Grimlock, Ferocious King", 1, Rarity.MYTHIC, mage.cards.g.GrimlockFerociousKing.class));
cards.add(new ExpansionSet.SetCardInfo("Grimlock, Dinobot Leader", "1a", Rarity.MYTHIC, mage.cards.g.GrimlockDinobotLeader.class));
cards.add(new ExpansionSet.SetCardInfo("Grimlock, Ferocious King", "1b", Rarity.MYTHIC, mage.cards.g.GrimlockFerociousKing.class));
cards.add(new ExpansionSet.SetCardInfo("Sword of Dungeons & Dragons", 3, Rarity.MYTHIC, mage.cards.s.SwordOfDungeonsAndDragons.class));
}
}

View file

@ -171,6 +171,9 @@ public class Homelands extends ExpansionSet {
cards.add(new SetCardInfo("Spectral Bears", 72, Rarity.UNCOMMON, mage.cards.s.SpectralBears.class));
cards.add(new SetCardInfo("Torture", 23, Rarity.COMMON, Torture.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Torture", 24, Rarity.COMMON, Torture.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Trade Caravan", 123, Rarity.COMMON, mage.cards.t.TradeCaravan.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Trade Caravan", 124, Rarity.COMMON, mage.cards.t.TradeCaravan.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Truce", 125, Rarity.RARE, mage.cards.t.Truce.class));
cards.add(new SetCardInfo("Veldrane of Sengir", 25, Rarity.RARE, mage.cards.v.VeldraneOfSengir.class));
cards.add(new SetCardInfo("Wall of Kelp", 50, Rarity.RARE, mage.cards.w.WallOfKelp.class));
cards.add(new SetCardInfo("Willow Faerie", 73, Rarity.COMMON, WillowFaerie.class, NON_FULL_USE_VARIOUS));

View file

@ -287,11 +287,11 @@ public class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Skeleton Ship", 379, Rarity.RARE, mage.cards.s.SkeletonShip.class));
cards.add(new SetCardInfo("Skull Catapult", 311, Rarity.UNCOMMON, mage.cards.s.SkullCatapult.class));
cards.add(new SetCardInfo("Snow Fortress", 312, Rarity.RARE, mage.cards.s.SnowFortress.class));
cards.add(new SetCardInfo("Snow-Covered Forest", 347, Rarity.COMMON, mage.cards.s.SnowCoveredForest.class));
cards.add(new SetCardInfo("Snow-Covered Island", 348, Rarity.COMMON, mage.cards.s.SnowCoveredIsland.class));
cards.add(new SetCardInfo("Snow-Covered Mountain", 349, Rarity.COMMON, mage.cards.s.SnowCoveredMountain.class));
cards.add(new SetCardInfo("Snow-Covered Plains", 350, Rarity.COMMON, mage.cards.s.SnowCoveredPlains.class));
cards.add(new SetCardInfo("Snow-Covered Swamp", 351, Rarity.COMMON, mage.cards.s.SnowCoveredSwamp.class));
cards.add(new SetCardInfo("Snow-Covered Forest", 347, Rarity.LAND, mage.cards.s.SnowCoveredForest.class));
cards.add(new SetCardInfo("Snow-Covered Island", 348, Rarity.LAND, mage.cards.s.SnowCoveredIsland.class));
cards.add(new SetCardInfo("Snow-Covered Mountain", 349, Rarity.LAND, mage.cards.s.SnowCoveredMountain.class));
cards.add(new SetCardInfo("Snow-Covered Plains", 350, Rarity.LAND, mage.cards.s.SnowCoveredPlains.class));
cards.add(new SetCardInfo("Snow-Covered Swamp", 351, Rarity.LAND, mage.cards.s.SnowCoveredSwamp.class));
cards.add(new SetCardInfo("Snow Hound", 277, Rarity.UNCOMMON, mage.cards.s.SnowHound.class));
cards.add(new SetCardInfo("Soldevi Golem", 313, Rarity.RARE, mage.cards.s.SoldeviGolem.class));
cards.add(new SetCardInfo("Soldevi Machinist", 102, Rarity.UNCOMMON, mage.cards.s.SoldeviMachinist.class));

View file

@ -279,19 +279,19 @@ public class MastersEditionIV extends ExpansionSet {
cards.add(new SetCardInfo("Two-Headed Giant of Foriys", 139, Rarity.UNCOMMON, mage.cards.t.TwoHeadedGiantOfForiys.class));
cards.add(new SetCardInfo("Underground Sea", 256, Rarity.RARE, mage.cards.u.UndergroundSea.class));
cards.add(new SetCardInfo("Urza's Chalice", 236, Rarity.COMMON, mage.cards.u.UrzasChalice.class));
cards.add(new SetCardInfo("Urza's Mine", "257a", Rarity.LAND, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257b", Rarity.LAND, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257c", Rarity.LAND, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257d", Rarity.LAND, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257a", Rarity.COMMON, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257b", Rarity.COMMON, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257c", Rarity.COMMON, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Mine", "257d", Rarity.COMMON, mage.cards.u.UrzasMine.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Miter", 237, Rarity.RARE, mage.cards.u.UrzasMiter.class));
cards.add(new SetCardInfo("Urza's Power Plant", "258a", Rarity.LAND, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258b", Rarity.LAND, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258c", Rarity.LAND, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258d", Rarity.LAND, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259a", Rarity.LAND, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259b", Rarity.LAND, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259c", Rarity.LAND, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259d", Rarity.LAND, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258a", Rarity.COMMON, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258b", Rarity.COMMON, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258c", Rarity.COMMON, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Power Plant", "258d", Rarity.COMMON, mage.cards.u.UrzasPowerPlant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259a", Rarity.COMMON, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259b", Rarity.COMMON, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259c", Rarity.COMMON, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Urza's Tower", "259d", Rarity.COMMON, mage.cards.u.UrzasTower.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Veteran Bodyguard", 32, Rarity.RARE, mage.cards.v.VeteranBodyguard.class));
cards.add(new SetCardInfo("Vibrating Sphere", 238, Rarity.RARE, mage.cards.v.VibratingSphere.class));
cards.add(new SetCardInfo("Volcanic Island", 260, Rarity.RARE, mage.cards.v.VolcanicIsland.class));

View file

@ -186,6 +186,7 @@ public class MercadianMasques extends ExpansionSet {
cards.add(new SetCardInfo("Howling Wolf", 252, Rarity.COMMON, mage.cards.h.HowlingWolf.class));
cards.add(new SetCardInfo("Hunted Wumpus", 253, Rarity.UNCOMMON, mage.cards.h.HuntedWumpus.class));
cards.add(new SetCardInfo("Ignoble Soldier", 22, Rarity.UNCOMMON, mage.cards.i.IgnobleSoldier.class));
cards.add(new SetCardInfo("Indentured Djinn", 85, Rarity.UNCOMMON, mage.cards.i.IndenturedDjinn.class));
cards.add(new SetCardInfo("Instigator", 140, Rarity.RARE, mage.cards.i.Instigator.class));
cards.add(new SetCardInfo("Intimidation", 142, Rarity.UNCOMMON, mage.cards.i.Intimidation.class));
cards.add(new SetCardInfo("Invigorate", 254, Rarity.COMMON, mage.cards.i.Invigorate.class));

View file

@ -218,10 +218,10 @@ public class OathOfTheGatewatch extends ExpansionSet {
cards.add(new SetCardInfo("Wandering Fumarole", 182, Rarity.RARE, mage.cards.w.WanderingFumarole.class));
cards.add(new SetCardInfo("Warden of Geometries", 11, Rarity.COMMON, mage.cards.w.WardenOfGeometries.class));
cards.add(new SetCardInfo("Warping Wail", 12, Rarity.UNCOMMON, mage.cards.w.WarpingWail.class));
cards.add(new SetCardInfo("Wastes", "183a", Rarity.COMMON, Wastes.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Wastes", "183b", Rarity.COMMON, Wastes.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Wastes", "184a", Rarity.COMMON, Wastes.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Wastes", "184b", Rarity.COMMON, Wastes.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Wastes", "183a", Rarity.LAND, Wastes.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Wastes", "183b", Rarity.LAND, Wastes.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Wastes", "184a", Rarity.LAND, Wastes.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Wastes", "184b", Rarity.LAND, Wastes.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Weapons Trainer", 160, Rarity.UNCOMMON, mage.cards.w.WeaponsTrainer.class));
cards.add(new SetCardInfo("Witness the End", 82, Rarity.COMMON, mage.cards.w.WitnessTheEnd.class));
cards.add(new SetCardInfo("World Breaker", 126, Rarity.MYTHIC, mage.cards.w.WorldBreaker.class));

View file

@ -28,7 +28,6 @@
package mage.sets;
import mage.cards.ExpansionSet;
import mage.cards.o.OrazcaFrillback;
import mage.constants.Rarity;
import mage.constants.SetType;
@ -55,19 +54,31 @@ public class RivalsOfIxalan extends ExpansionSet {
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;
this.numBoosterDoubleFaced = -1;
this.maxCardNumberInBooster = 196;
cards.add(new SetCardInfo("Admiral's Order", 31, Rarity.RARE, mage.cards.a.AdmiralsOrder.class));
cards.add(new SetCardInfo("Aggressive Urge", 122, Rarity.COMMON, mage.cards.a.AggressiveUrge.class));
cards.add(new SetCardInfo("Angrath, Minotaur Pirate", 201, Rarity.MYTHIC, mage.cards.a.AngrathMinotaurPirate.class));
cards.add(new SetCardInfo("Angrath's Ambusher", 202, Rarity.UNCOMMON, mage.cards.a.AngrathsAmbusher.class));
cards.add(new SetCardInfo("Angrath's Fury", 204, Rarity.RARE, mage.cards.a.AngrathsFury.class));
cards.add(new SetCardInfo("Angrath, the Flame-Chained", 152, Rarity.MYTHIC, mage.cards.a.AngrathTheFlameChained.class));
cards.add(new SetCardInfo("Aquatic Incursion", 32, Rarity.UNCOMMON, mage.cards.a.AquaticIncursion.class));
cards.add(new SetCardInfo("Arch of Orazca", 185, Rarity.RARE, mage.cards.a.ArchOfOrazca.class));
cards.add(new SetCardInfo("Arterial Flow", 62, Rarity.UNCOMMON, mage.cards.a.ArterialFlow.class));
cards.add(new SetCardInfo("Atzal, Cave of Eternity", "160b", Rarity.RARE, mage.cards.a.AtzalCaveOfEternity.class));
cards.add(new SetCardInfo("Atzocan Seer", "153a", Rarity.UNCOMMON, mage.cards.a.AtzocanSeer.class));
cards.add(new SetCardInfo("Azor's Gateway", 176, Rarity.MYTHIC, mage.cards.a.AzorsGateway.class));
cards.add(new SetCardInfo("Atzocan Seer", 153, Rarity.UNCOMMON, mage.cards.a.AtzocanSeer.class));
cards.add(new SetCardInfo("Awakened Amalgam", 175, Rarity.RARE, mage.cards.a.AwakenedAmalgam.class));
cards.add(new SetCardInfo("Azor's Gateway", "176a", Rarity.MYTHIC, mage.cards.a.AzorsGateway.class));
cards.add(new SetCardInfo("Azor, the Lawbringer", 154, Rarity.MYTHIC, mage.cards.a.AzorTheLawbringer.class));
cards.add(new SetCardInfo("Baffling End", 1, Rarity.UNCOMMON, mage.cards.b.BafflingEnd.class));
cards.add(new SetCardInfo("Bishop of Binding", 2, Rarity.RARE, mage.cards.b.BishopOfBinding.class));
cards.add(new SetCardInfo("Blazing Hope", 3, Rarity.UNCOMMON, mage.cards.b.BlazingHope.class));
cards.add(new SetCardInfo("Blood Sun", 92, Rarity.RARE, mage.cards.b.BloodSun.class));
cards.add(new SetCardInfo("Bombard", 93, Rarity.COMMON, mage.cards.b.Bombard.class));
cards.add(new SetCardInfo("Brass's Bounty", 94, Rarity.RARE, mage.cards.b.BrasssBounty.class));
cards.add(new SetCardInfo("Brazen Freebooter", 95, Rarity.COMMON, mage.cards.b.BrazenFreebooter.class));
cards.add(new SetCardInfo("Buccaneer's Bravado", 96, Rarity.COMMON, mage.cards.b.BuccaneersBravado.class));
cards.add(new SetCardInfo("Cacophodon", 123, Rarity.UNCOMMON, mage.cards.c.Cacophodon.class));
cards.add(new SetCardInfo("Canal Monitor", 63, Rarity.COMMON, mage.cards.c.CanalMonitor.class));
cards.add(new SetCardInfo("Captain's Hook", 177, Rarity.RARE, mage.cards.c.CaptainsHook.class));
@ -99,7 +110,7 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Etali, Primal Storm", 100, Rarity.RARE, mage.cards.e.EtaliPrimalStorm.class));
cards.add(new SetCardInfo("Everdawn Champion", 6, Rarity.UNCOMMON, mage.cards.e.EverdawnChampion.class));
cards.add(new SetCardInfo("Evolving Wilds", 186, Rarity.COMMON, mage.cards.e.EvolvingWilds.class));
cards.add(new SetCardInfo("Expel From Orazca", 37, Rarity.UNCOMMON, mage.cards.e.ExpelFromOrazca.class));
cards.add(new SetCardInfo("Expel from Orazca", 37, Rarity.UNCOMMON, mage.cards.e.ExpelFromOrazca.class));
cards.add(new SetCardInfo("Exultant Skymarcher", 7, Rarity.COMMON, mage.cards.e.ExultantSkymarcher.class));
cards.add(new SetCardInfo("Famished Paladin", 8, Rarity.UNCOMMON, mage.cards.f.FamishedPaladin.class));
cards.add(new SetCardInfo("Fanatical Firebrand", 101, Rarity.COMMON, mage.cards.f.FanaticalFirebrand.class));
@ -109,7 +120,7 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Forerunner of the Empire", 102, Rarity.UNCOMMON, mage.cards.f.ForerunnerOfTheEmpire.class));
cards.add(new SetCardInfo("Forerunner of the Heralds", 129, Rarity.UNCOMMON, mage.cards.f.ForerunnerOfTheHeralds.class));
cards.add(new SetCardInfo("Forerunner of the Legion", 9, Rarity.UNCOMMON, mage.cards.f.ForerunnerOfTheLegion.class));
cards.add(new SetCardInfo("Forest", 196, Rarity.COMMON, mage.cards.basiclands.Forest.class));
cards.add(new SetCardInfo("Forest", 196, Rarity.LAND, mage.cards.basiclands.Forest.class));
cards.add(new SetCardInfo("Form of the Dinosaur", 103, Rarity.RARE, mage.cards.f.FormOfTheDinosaur.class));
cards.add(new SetCardInfo("Forsaken Sanctuary", 187, Rarity.UNCOMMON, mage.cards.f.ForsakenSanctuary.class));
cards.add(new SetCardInfo("Foul Orchard", 188, Rarity.UNCOMMON, mage.cards.f.FoulOrchard.class));
@ -132,7 +143,7 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Impale", 76, Rarity.COMMON, mage.cards.i.Impale.class));
cards.add(new SetCardInfo("Imperial Ceratops", 10, Rarity.UNCOMMON, mage.cards.i.ImperialCeratops.class));
cards.add(new SetCardInfo("Induced Amnesia", 40, Rarity.RARE, mage.cards.i.InducedAmnesia.class));
cards.add(new SetCardInfo("Island", 193, Rarity.COMMON, mage.cards.basiclands.Island.class));
cards.add(new SetCardInfo("Island", 193, Rarity.LAND, mage.cards.basiclands.Island.class));
cards.add(new SetCardInfo("Jade Bearer", 134, Rarity.COMMON, mage.cards.j.JadeBearer.class));
cards.add(new SetCardInfo("Jadecraft Artisan", 135, Rarity.COMMON, mage.cards.j.JadecraftArtisan.class));
cards.add(new SetCardInfo("Jadelight Ranger", 136, Rarity.RARE, mage.cards.j.JadelightRanger.class));
@ -155,14 +166,14 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Mist-Cloaked Herald", 43, Rarity.COMMON, mage.cards.m.MistCloakedHerald.class));
cards.add(new SetCardInfo("Moment of Craving", 79, Rarity.COMMON, mage.cards.m.MomentOfCraving.class));
cards.add(new SetCardInfo("Moment of Triumph", 15, Rarity.COMMON, mage.cards.m.MomentOfTriumph.class));
cards.add(new SetCardInfo("Mountain", 195, Rarity.COMMON, mage.cards.basiclands.Mountain.class));
cards.add(new SetCardInfo("Mountain", 195, Rarity.LAND, mage.cards.basiclands.Mountain.class));
cards.add(new SetCardInfo("Mutiny", 106, Rarity.COMMON, mage.cards.m.Mutiny.class));
cards.add(new SetCardInfo("Naturalize", 139, Rarity.COMMON, mage.cards.n.Naturalize.class));
cards.add(new SetCardInfo("Needletooth Raptor", 107, Rarity.UNCOMMON, mage.cards.n.NeedletoothRaptor.class));
cards.add(new SetCardInfo("Negate", 44, Rarity.COMMON, mage.cards.n.Negate.class));
cards.add(new SetCardInfo("Nezahal, Primal Tide", 45, Rarity.RARE, mage.cards.n.NezahalPrimalTide.class));
cards.add(new SetCardInfo("Oathsworn Vampire", 80, Rarity.UNCOMMON, mage.cards.o.OathswornVampire.class));
cards.add(new SetCardInfo("Orazca Frillback", 140, Rarity.COMMON, OrazcaFrillback.class));
cards.add(new SetCardInfo("Orazca Frillback", 140, Rarity.COMMON, mage.cards.o.OrazcaFrillback.class));
cards.add(new SetCardInfo("Orazca Raptor", 108, Rarity.COMMON, mage.cards.o.OrazcaRaptor.class));
cards.add(new SetCardInfo("Orazca Relic", 181, Rarity.COMMON, mage.cards.o.OrazcaRelic.class));
cards.add(new SetCardInfo("Overgrown Armasaur", 141, Rarity.COMMON, mage.cards.o.OvergrownArmasaur.class));
@ -171,7 +182,7 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Path of Mettle", "165a", Rarity.RARE, mage.cards.p.PathOfMettle.class));
cards.add(new SetCardInfo("Pirate's Pillage", 109, Rarity.UNCOMMON, mage.cards.p.PiratesPillage.class));
cards.add(new SetCardInfo("Pitiless Plunderer", 81, Rarity.UNCOMMON, mage.cards.p.PitilessPlunderer.class));
cards.add(new SetCardInfo("Plains", 192, Rarity.COMMON, mage.cards.basiclands.Plains.class));
cards.add(new SetCardInfo("Plains", 192, Rarity.LAND, mage.cards.basiclands.Plains.class));
cards.add(new SetCardInfo("Plummet", 143, Rarity.COMMON, mage.cards.p.Plummet.class));
cards.add(new SetCardInfo("Polyraptor", 144, Rarity.MYTHIC, mage.cards.p.Polyraptor.class));
cards.add(new SetCardInfo("Pride of Conquerors", 17, Rarity.UNCOMMON, mage.cards.p.PrideOfConquerors.class));
@ -180,14 +191,14 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Radiant Destiny", 18, Rarity.RARE, mage.cards.r.RadiantDestiny.class));
cards.add(new SetCardInfo("Raging Regisaur", 168, Rarity.UNCOMMON, mage.cards.r.RagingRegisaur.class));
cards.add(new SetCardInfo("Raptor Companion", 19, Rarity.COMMON, mage.cards.r.RaptorCompanion.class));
cards.add(new SetCardInfo("Ravenous Chupacabra", 82, Rarity.COMMON, mage.cards.r.RavenousChupacabra.class));
cards.add(new SetCardInfo("Ravenous Chupacabra", 82, Rarity.UNCOMMON, mage.cards.r.RavenousChupacabra.class));
cards.add(new SetCardInfo("Reaver Ambush", 83, Rarity.UNCOMMON, mage.cards.r.ReaverAmbush.class));
cards.add(new SetCardInfo("Reckless Rage", 110, Rarity.UNCOMMON, mage.cards.r.RecklessRage.class));
cards.add(new SetCardInfo("Recover", 84, Rarity.COMMON, mage.cards.r.Recover.class));
cards.add(new SetCardInfo("Rekindling Phoenix", 111, Rarity.MYTHIC, mage.cards.r.RekindlingPhoenix.class));
cards.add(new SetCardInfo("Relentless Raptor", 169, Rarity.UNCOMMON, mage.cards.r.RelentlessRaptor.class));
cards.add(new SetCardInfo("Resplendent Griffin", 170, Rarity.UNCOMMON, mage.cards.r.ResplendentGriffin.class));
cards.add(new SetCardInfo("Return to the Wind", 46, Rarity.RARE, mage.cards.r.ReturnToTheWind.class));
cards.add(new SetCardInfo("Release to the Wind", 46, Rarity.RARE, mage.cards.r.ReleaseToTheWind.class));
cards.add(new SetCardInfo("River Darter", 47, Rarity.COMMON, mage.cards.r.RiverDarter.class));
cards.add(new SetCardInfo("Riverwise Augur", 48, Rarity.UNCOMMON, mage.cards.r.RiverwiseAugur.class));
cards.add(new SetCardInfo("Sadistic Skymarcher", 85, Rarity.UNCOMMON, mage.cards.s.SadisticSkymarcher.class));
@ -225,7 +236,7 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Sun-Crested Pterodon", 27, Rarity.COMMON, mage.cards.s.SunCrestedPterodon.class));
cards.add(new SetCardInfo("Swab Goblin", 203, Rarity.COMMON, mage.cards.s.SwabGoblin.class));
cards.add(new SetCardInfo("Swaggering Corsair", 119, Rarity.COMMON, mage.cards.s.SwaggeringCorsair.class));
cards.add(new SetCardInfo("Swamp", 194, Rarity.COMMON, mage.cards.basiclands.Swamp.class));
cards.add(new SetCardInfo("Swamp", 194, Rarity.LAND, mage.cards.basiclands.Swamp.class));
cards.add(new SetCardInfo("Swift Warden", 146, Rarity.UNCOMMON, mage.cards.s.SwiftWarden.class));
cards.add(new SetCardInfo("Sworn Guardian", 58, Rarity.COMMON, mage.cards.s.SwornGuardian.class));
cards.add(new SetCardInfo("Temple Altisaur", 28, Rarity.RARE, mage.cards.t.TempleAltisaur.class));
@ -234,7 +245,7 @@ public class RivalsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("The Immortal Sun", 180, Rarity.MYTHIC, mage.cards.t.TheImmortalSun.class));
cards.add(new SetCardInfo("Thrashing Brontodon", 148, Rarity.UNCOMMON, mage.cards.t.ThrashingBrontodon.class));
cards.add(new SetCardInfo("Thunderherd Migration", 149, Rarity.UNCOMMON, mage.cards.t.ThunderherdMigration.class));
cards.add(new SetCardInfo("Tilonali's Crown", 120, Rarity.COMMON, mage.cards.t.TilonalisCrown.class));
cards.add(new SetCardInfo("Tilonalli's Crown", 120, Rarity.COMMON, mage.cards.t.TilonallisCrown.class));
cards.add(new SetCardInfo("Tilonalli's Summoner", 121, Rarity.RARE, mage.cards.t.TilonallisSummoner.class));
cards.add(new SetCardInfo("Timestream Navigator", 59, Rarity.MYTHIC, mage.cards.t.TimestreamNavigator.class));
cards.add(new SetCardInfo("Tomb of the Dusk Rose", "166b", Rarity.RARE, mage.cards.t.TombOfTheDuskRose.class));

View file

@ -136,7 +136,7 @@ public class ShadowsOverInnistrad extends ExpansionSet {
cards.add(new SetCardInfo("Dual Shot", 153, Rarity.COMMON, mage.cards.d.DualShot.class));
cards.add(new SetCardInfo("Duskwatch Recruiter", 203, Rarity.UNCOMMON, mage.cards.d.DuskwatchRecruiter.class));
cards.add(new SetCardInfo("Eerie Interlude", 16, Rarity.RARE, mage.cards.e.EerieInterlude.class));
cards.add(new SetCardInfo("Elusive Tormentor", 108, Rarity.RARE, mage.cards.e.ElusiveTormentor.class));
cards.add(new SetCardInfo("Elusive Tormentor", "108a", Rarity.RARE, mage.cards.e.ElusiveTormentor.class));
cards.add(new SetCardInfo("Ember-Eye Wolf", 154, Rarity.COMMON, mage.cards.e.EmberEyeWolf.class));
cards.add(new SetCardInfo("Emissary of the Sleepless", 17, Rarity.COMMON, mage.cards.e.EmissaryOfTheSleepless.class));
cards.add(new SetCardInfo("Engulf the Shore", 58, Rarity.RARE, mage.cards.e.EngulfTheShore.class));
@ -207,7 +207,7 @@ public class ShadowsOverInnistrad extends ExpansionSet {
cards.add(new SetCardInfo("Infectious Curse", 97, Rarity.UNCOMMON, mage.cards.i.InfectiousCurse.class));
cards.add(new SetCardInfo("Inner Struggle", 167, Rarity.UNCOMMON, mage.cards.i.InnerStruggle.class));
cards.add(new SetCardInfo("Inquisitor's Ox", 24, Rarity.COMMON, mage.cards.i.InquisitorsOx.class));
cards.add(new SetCardInfo("Insidious Mist", 108, Rarity.RARE, mage.cards.i.InsidiousMist.class));
cards.add(new SetCardInfo("Insidious Mist", "108b", Rarity.RARE, mage.cards.i.InsidiousMist.class));
cards.add(new SetCardInfo("Insolent Neonate", 168, Rarity.COMMON, mage.cards.i.InsolentNeonate.class));
cards.add(new SetCardInfo("Inspiring Captain", 25, Rarity.COMMON, mage.cards.i.InspiringCaptain.class));
cards.add(new SetCardInfo("Intrepid Provisioner", 213, Rarity.COMMON, mage.cards.i.IntrepidProvisioner.class));

View file

@ -20,10 +20,27 @@ public class Unglued extends ExpansionSet {
private Unglued() {
super("Unglued", "UGL", ExpansionSet.buildDate(1998, 8, 11), SetType.JOKESET);
cards.add(new SetCardInfo("Chicken Egg", 41, Rarity.COMMON, mage.cards.c.ChickenEgg.class));
cards.add(new SetCardInfo("Chicken a la King", 17, Rarity.RARE, mage.cards.c.ChickenALaKing.class));
cards.add(new SetCardInfo("Forest", 88, Rarity.LAND, mage.cards.basiclands.Forest.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Fowl Play", 24, Rarity.COMMON, mage.cards.f.FowlPlay.class));
cards.add(new SetCardInfo("Goblin Tutor", 45, Rarity.UNCOMMON, mage.cards.g.GoblinTutor.class));
cards.add(new SetCardInfo("Growth Spurt", 61, Rarity.COMMON, mage.cards.g.GrowthSpurt.class));
cards.add(new SetCardInfo("Hungry Hungry Heifer", 63, Rarity.UNCOMMON, mage.cards.h.HungryHungryHeifer.class));
cards.add(new SetCardInfo("Incoming!", 64, Rarity.RARE, mage.cards.i.Incoming.class));
cards.add(new SetCardInfo("Island", 85, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Jack-in-the-Mox", 75, Rarity.RARE, mage.cards.j.JackInTheMox.class));
cards.add(new SetCardInfo("Jumbo Imp", 34, Rarity.UNCOMMON, mage.cards.j.JumboImp.class));
cards.add(new SetCardInfo("Krazy Kow", 48, Rarity.COMMON, mage.cards.k.KrazyKow.class));
cards.add(new SetCardInfo("Mountain", 87, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Paper Tiger", 78, Rarity.COMMON, mage.cards.p.PaperTiger.class));
cards.add(new SetCardInfo("Plains", 84, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Poultrygeist", 37, Rarity.COMMON, mage.cards.p.Poultrygeist.class));
cards.add(new SetCardInfo("Rock Lobster", 79, Rarity.COMMON, mage.cards.r.RockLobster.class));
cards.add(new SetCardInfo("Scissors Lizard", 80, Rarity.COMMON, mage.cards.s.ScissorsLizard.class));
cards.add(new SetCardInfo("Swamp", 86, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("The Cheese Stands Alone", 2, Rarity.RARE, mage.cards.t.TheCheeseStandsAlone.class));
cards.add(new SetCardInfo("Timmy, Power Gamer", 68, Rarity.RARE, mage.cards.t.TimmyPowerGamer.class));
}
}

View file

@ -63,6 +63,7 @@ public class Visions extends ExpansionSet {
cards.add(new SetCardInfo("Brass-Talon Chimera", 142, Rarity.UNCOMMON, mage.cards.b.BrassTalonChimera.class));
cards.add(new SetCardInfo("Breathstealer's Crypt", 127, Rarity.RARE, mage.cards.b.BreathstealersCrypt.class));
cards.add(new SetCardInfo("Breezekeeper", 27, Rarity.COMMON, mage.cards.b.Breezekeeper.class));
cards.add(new SetCardInfo("Brood of Cockroaches", 3, Rarity.UNCOMMON, mage.cards.b.BroodOfCockroaches.class));
cards.add(new SetCardInfo("Bull Elephant", 51, Rarity.COMMON, mage.cards.b.BullElephant.class));
cards.add(new SetCardInfo("Chronatog", 28, Rarity.RARE, mage.cards.c.Chronatog.class));
cards.add(new SetCardInfo("City of Solitude", 52, Rarity.RARE, mage.cards.c.CityOfSolitude.class));

View file

@ -0,0 +1,104 @@
package org.mage.test.cards.single.vis;
import mage.game.permanent.Permanent;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;
import static mage.constants.Zone.*;
import static mage.constants.PhaseStep.*;
public class BroodOfCockroachesTest extends CardTestPlayerBase {
private static final int TURN_1 = 1;
private static final int ANY_LIFE_TOTAL = 17;
private static final String BROOD_OF_COCKROACHES = "Brood of Cockroaches";
private static final String SHOCK = "Shock";
@Test
public void should_display_correct_text() {
String expectedText = "When {this} dies, at the beginning of the next end step, you lose 1 life and return Brood of Cockroaches to your hand.";
playerA_casts_Brood_of_Cockroaches_at_precombat_main_phase();
setStopAt(TURN_1, END_TURN);
execute();
Permanent permanent = getPermanent(BROOD_OF_COCKROACHES, playerA);
assertThat(permanent.getAbilities().get(1).toString(), is(expectedText));
}
@Test
public void should_reduce_life_of_playerA_by_1_at_the_beginning_of_the_next_end_step() {
playerA.setLife(ANY_LIFE_TOTAL, currentGame);
playerA_casts_Brood_of_Cockroaches_at_precombat_main_phase();
brood_of_cockroaches_diesat_precombat_main_phase();
setStopAt(TURN_1, END_TURN);
execute();
assertLife(playerA, ANY_LIFE_TOTAL - 1);
}
@Test
public void should_not_reduce_life_of_playerA_by_1_at_post_combat_main_step() {
playerA.setLife(ANY_LIFE_TOTAL, currentGame);
playerA_casts_Brood_of_Cockroaches_at_precombat_main_phase();
brood_of_cockroaches_diesat_precombat_main_phase();
setStopAt(TURN_1, PRECOMBAT_MAIN);
execute();
assertLife(playerA, ANY_LIFE_TOTAL );
}
@Test
public void should_return_Brood_of_Cockroaches_to_playerA_hand_end_of_turn() {
playerA.setLife(ANY_LIFE_TOTAL, currentGame);
playerA_casts_Brood_of_Cockroaches_at_precombat_main_phase();
brood_of_cockroaches_diesat_precombat_main_phase();
setStopAt(TURN_1, END_TURN);
execute();
assertHandCount(playerA, BROOD_OF_COCKROACHES, 1);
}
@Test
public void should_not_return_Brood_of_Cockroaches_to_playerA_at_post_combat_step() {
playerA.setLife(ANY_LIFE_TOTAL, currentGame);
playerA_casts_Brood_of_Cockroaches_at_precombat_main_phase();
brood_of_cockroaches_diesat_precombat_main_phase();
setStopAt(TURN_1, POSTCOMBAT_MAIN);
execute();
assertHandCount(playerA, BROOD_OF_COCKROACHES, 0);
}
private void brood_of_cockroaches_diesat_precombat_main_phase() {
addCard(BATTLEFIELD, playerB, "Mountain", 1);
addCard(HAND, playerB, SHOCK, 1);
castSpell(TURN_1, PRECOMBAT_MAIN, playerB, SHOCK, BROOD_OF_COCKROACHES);
}
private void playerA_casts_Brood_of_Cockroaches_at_precombat_main_phase() {
addCard(BATTLEFIELD, playerA, "Swamp", 2);
addCard(HAND, playerA, BROOD_OF_COCKROACHES, 1);
castSpell(TURN_1, PRECOMBAT_MAIN, playerA, BROOD_OF_COCKROACHES);
}
}

View file

@ -8,6 +8,7 @@ import mage.cards.decks.DeckCardLists;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.constants.ColoredManaSymbol;
import mage.constants.MatchTimeLimit;
import mage.constants.MultiplayerAttackOption;
import mage.constants.RangeOfInfluence;
import mage.game.match.MatchOptions;
@ -275,6 +276,7 @@ public class LoadTest {
options.setAttackOption(MultiplayerAttackOption.MULTIPLE);
options.setRange(RangeOfInfluence.ALL);
options.setWinsNeeded(1);
options.setMatchTimeLimit(MatchTimeLimit.MIN__15);
return options;
}

View file

@ -116,7 +116,6 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
if (currentGame != null) {
logger.debug("Resetting previous game and creating new one!");
currentGame = null;
System.gc();
}
currentGame = createNewGameAndPlayers();

View file

@ -4,6 +4,8 @@ import mage.ObjectColor;
import mage.cards.*;
import mage.cards.basiclands.BasicLand;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.SuperType;
import org.junit.Assert;
import org.junit.Test;
@ -30,6 +32,12 @@ public class VerifyCardDataTest {
static {
// skip lists for checks (example: unstable cards with same name may have different stats)
// TODO: mtgjson have wrong data for UGL
// remove after fixed
// https://github.com/mtgjson/mtgjson/issues/531
// https://github.com/mtgjson/mtgjson/issues/534
// https://github.com/mtgjson/mtgjson/issues/535
// power-toughness
skipListCreate("PT");
skipListAddName("PT", "Garbage Elemental"); // UST
@ -37,19 +45,25 @@ public class VerifyCardDataTest {
// color
skipListCreate("COLOR");
//skipListAddName("COLOR", "Ulrich, Uncontested Alpha"); // gatherer is missing the color indicator on one card and json has wrong data (16.12.2017: not actual)
// cost
skipListCreate("COST");
// supertype
skipListCreate("SUPERTYPE");
skipListAddName("SUPERTYPE", "Timmy, Power Gamer"); // UGL, mtgjson error
// type
skipListCreate("TYPE");
skipListAddName("TYPE", "Fowl Play"); // UGL, mtgjson error
// subtype
skipListCreate("SUBTYPE");
skipListAddName("SUBTYPE", "Timmy, Power Gamer"); // UGL, mtgjson error
skipListAddName("SUBTYPE", "Fowl Play"); // UGL, mtgjson error
skipListAddName("SUBTYPE", "Paper Tiger"); // UGL, mtgjson error
skipListAddName("SUBTYPE", "Rock Lobster"); // UGL, mtgjson error
skipListAddName("SUBTYPE", "Scissors Lizard"); // UGL, mtgjson error
// number
skipListCreate("NUMBER");
@ -76,7 +90,7 @@ public class VerifyCardDataTest {
private void fail(Card card, String category, String message) {
failed++;
System.out.println("Error: (" + category + ") " + message + " for " + card.getName());
System.out.println("Error: (" + category + ") " + message + " for " + card.getName() + " (" + card.getExpansionSetCode() + ")");
}
private int failed = 0;
@ -280,6 +294,7 @@ public class VerifyCardDataTest {
checkTypes(card, ref);
checkColors(card, ref);
//checkNumbers(card, ref); // TODO: load data from allsets.json and check it (allcards.json do not have card numbers)
checkBasicLands(card, ref);
}
private void checkColors(Card card, JsonCard ref) {
@ -393,6 +408,48 @@ public class VerifyCardDataTest {
}
}
private boolean isBasicLandName(String name) {
String checkName = name;
if (name.startsWith("Snow-Covered ")) {
// snow lands is basic lands too
checkName = name.replace("Snow-Covered ", "");
}
return checkName.equals("Island") ||
checkName.equals("Forest") ||
checkName.equals("Swamp") ||
checkName.equals("Plains") ||
checkName.equals("Mountain") ||
checkName.equals("Wastes");
}
private void checkBasicLands(Card card, JsonCard ref) {
// basic lands must have Rarity.LAND and SuperType.BASIC
// other cards can't have that stats
if (isBasicLandName(card.getName())) {
// lands
if (card.getRarity() != Rarity.LAND) {
fail(card, "rarity", "basic land must be Rarity.LAND");
}
if (!card.getSuperType().contains(SuperType.BASIC)) {
fail(card, "supertype", "basic land must be SuperType.BASIC");
}
} else {
// non lands
if (card.getRarity() == Rarity.LAND) {
fail(card, "rarity", "only basic land can be Rarity.LAND");
}
if (card.getSuperType().contains(SuperType.BASIC)) {
fail(card, "supertype", "only basic land can be SuperType.BASIC");
}
}
}
private String join(Iterable<?> items) {
StringBuilder result = new StringBuilder();
for (Object item : items) {

View file

@ -27,11 +27,12 @@
*/
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
@ -51,7 +52,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
/**
* optional = false<br>
* opponentController = false
*
*
* @param effect
*/
public CreatureEntersBattlefieldTriggeredAbility(Effect effect) {
@ -60,7 +61,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
/**
* opponentController = false
*
*
* @param effect
* @param optional
*/
@ -69,7 +70,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
}
/**
*
*
* @param effect
* @param optional
* @param opponentController
@ -78,7 +79,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
this(Zone.BATTLEFIELD, effect, optional, opponentController);
}
/**
* @param zone
* @param effect
@ -104,7 +105,6 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
}
}
public CreatureEntersBattlefieldTriggeredAbility(CreatureEntersBattlefieldTriggeredAbility ability) {
super(ability);
this.opponentController = ability.opponentController;
@ -118,7 +118,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
if (filter.match(permanent, sourceId, controllerId, game)
&& (permanent.getControllerId().equals(this.controllerId) ^ opponentController)) {
if (!this.getTargets().isEmpty()) {
@ -137,7 +137,7 @@ public class CreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityI
@Override
public String getRule() {
return "Whenever a " + filter.getMessage() +" enters the battlefield under "
return "Whenever a " + filter.getMessage() + " enters the battlefield under "
+ (opponentController ? "an opponent's control, " : "your control, ")
+ super.getRule();
}

View file

@ -27,10 +27,12 @@
*/
package mage.abilities.effects.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
@ -38,8 +40,6 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -129,6 +129,11 @@ public class DamageTargetEffect extends OneShotEffect {
this.sourceName = sourceName;
}
public Effect setUseOnlyTargetPointer(boolean useOnlyTargetPointer) {
this.useOnlyTargetPointer = useOnlyTargetPointer;
return this;
}
@Override
public DamageTargetEffect copy() {
return new DamageTargetEffect(this);
@ -152,7 +157,7 @@ public class DamageTargetEffect extends OneShotEffect {
}
return true;
}
for (UUID targetId :this.getTargetPointer().getTargets(game, source)) {
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);

View file

@ -36,7 +36,9 @@ public class DoIfCostPaid extends OneShotEffect {
public DoIfCostPaid(Effect effect, Cost cost, String chooseUseText, boolean optional) {
super(Outcome.Benefit);
this.executingEffects.add(effect);
if (effect != null) {
this.executingEffects.add(effect);
}
this.cost = cost;
this.chooseUseText = chooseUseText;
this.optional = optional;
@ -74,10 +76,9 @@ public class DoIfCostPaid extends OneShotEffect {
message = CardUtil.replaceSourceName(message, mageObject.getLogName());
boolean result = true;
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
&& (!optional || player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) {
&& executingEffects.size() > 0 && (!optional || player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) {
cost.clearPaid();
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
game.applyEffects(); // To end effects e.g. of sacrificed permanents
for (Effect effect : executingEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -87,7 +88,8 @@ public class DoIfCostPaid extends OneShotEffect {
}
}
player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek
} else if (!otherwiseEffects.isEmpty()) {
}
else if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -97,7 +99,8 @@ public class DoIfCostPaid extends OneShotEffect {
}
}
}
} else if (!otherwiseEffects.isEmpty()) {
}
else if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {

View file

@ -32,10 +32,8 @@ import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.AdjustingSourceCosts;
import mage.abilities.effects.common.AffinityEffect;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.util.CardUtil;
@ -43,14 +41,9 @@ import mage.util.CardUtil;
* Affinity for artifacts
*/
public class AffinityForArtifactsAbility extends SimpleStaticAbility implements AdjustingSourceCosts {
private static final FilterControlledPermanent filter = new FilterControlledPermanent();
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public AffinityForArtifactsAbility() {
super(Zone.OUTSIDE, new AffinityEffect(filter));
super(Zone.OUTSIDE, new AffinityEffect(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT));
setRuleAtTheTop(true);
}
@ -71,7 +64,7 @@ public class AffinityForArtifactsAbility extends SimpleStaticAbility implements
@Override
public void adjustCosts(Ability ability, Game game) {
if (ability instanceof SpellAbility) {
int count = game.getBattlefield().getAllActivePermanents(filter, ability.getControllerId(), game).size();
int count = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, ability.getControllerId(), game).size();
if (count > 0) {
CardUtil.adjustCost((SpellAbility)ability, count);
}

View file

@ -27,22 +27,23 @@
*/
package mage.abilities.keyword;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetControlledPermanent;
import mage.util.CardUtil;
import java.util.Objects;
import java.util.UUID;
/**
* 702.84. Annihilator 702.84a Annihilator is a triggered ability. "Annihilator
* N" means "Whenever this creature attacks, defending player sacrifices N
@ -103,7 +104,6 @@ public class AnnihilatorAbility extends TriggeredAbilityImpl {
class AnnihilatorEffect extends OneShotEffect {
private final int count;
private static final FilterControlledPermanent FILTER = new FilterControlledPermanent();
AnnihilatorEffect(int count) {
super(Outcome.Sacrifice);
@ -123,21 +123,19 @@ class AnnihilatorEffect extends OneShotEffect {
player = game.getPlayer(defendingPlayerId);
}
if (player != null) {
int amount = Math.min(count, game.getBattlefield().countAll(FILTER, player.getId(), game));
int amount = Math.min(count, game.getBattlefield().countAll(StaticFilters.FILTER_CONTROLLED_PERMANENT, player.getId(), game));
if (amount > 0) {
Target target = new TargetControlledPermanent(amount, amount, FILTER, true);
Target target = new TargetControlledPermanent(amount, amount, StaticFilters.FILTER_CONTROLLED_PERMANENT, true);
if (target.canChoose(player.getId(), game)) {
while (player.canRespond()
&& target.canChoose(player.getId(), game)
&& !target.isChosen()) {
player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
}
for (int idx = 0; idx < target.getTargets().size(); idx++) {
Permanent permanent = game.getPermanent(target.getTargets().get(idx));
if (permanent != null) {
permanent.sacrifice(source.getSourceId(), game);
}
}
target.getTargets().stream()
.map(game::getPermanent)
.filter(Objects::nonNull)
.forEach(permanent -> permanent.sacrifice(source.getSourceId(), game));
}
return true;
}

View file

@ -56,7 +56,7 @@ public class ChangelingAbility extends StaticAbility implements MageSingleton {
}
private ChangelingAbility() {
super(Zone.BATTLEFIELD, null);
super(Zone.ALL, null);
}
@Override

View file

@ -58,7 +58,7 @@ public enum CardRepository {
// raise this if db structure was changed
private static final long CARD_DB_VERSION = 51;
// raise this if new cards were added to the server
private static final long CARD_CONTENT_VERSION = 97;
private static final long CARD_CONTENT_VERSION = 100;
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;
@ -330,7 +330,6 @@ public enum CardRepository {
return findPreferedCoreExpansionCard(name, caseInsensitive, null);
}
public CardInfo findPreferedCoreExpansionCard(String name, boolean caseInsensitive, String preferedSetCode) {
List<CardInfo> cards;
@ -348,7 +347,7 @@ public enum CardRepository {
ExpansionInfo set = ExpansionRepository.instance.getSetByCode(cardinfo.getSetCode());
if (set != null) {
if ((preferedSetCode != null) && (preferedSetCode.equals(set.getCode()))){
if ((preferedSetCode != null) && (preferedSetCode.equals(set.getCode()))) {
return cardinfo;
}

View file

@ -85,12 +85,14 @@ public enum SubType {
CENTAUR("Centaur", SubTypeSet.CreatureType),
CEREAN("Cerean", SubTypeSet.CreatureType, true), // Star Wars
CEPHALID("Cephalid", SubTypeSet.CreatureType),
CHICKEN("Chicken", SubTypeSet.CreatureType, true), // Unglued
CHIMERA("Chimera", SubTypeSet.CreatureType),
CHISS("Chiss", SubTypeSet.CreatureType, true),
CITIZEN("Citizen", SubTypeSet.CreatureType),
CLERIC("Cleric", SubTypeSet.CreatureType),
COCKATRICE("Cockatrice", SubTypeSet.CreatureType),
CONSTRUCT("Construct", SubTypeSet.CreatureType),
COW("Cow", SubTypeSet.CreatureType, true), // Unglued
COWARD("Coward", SubTypeSet.CreatureType),
CRAB("Crab", SubTypeSet.CreatureType),
CROCODILE("Crocodile", SubTypeSet.CreatureType),
@ -114,6 +116,7 @@ public enum SubType {
DWARF("Dwarf", SubTypeSet.CreatureType),
// E
EFREET("Efreet", SubTypeSet.CreatureType),
EGG("Egg", SubTypeSet.CreatureType),
ELDER("Elder", SubTypeSet.CreatureType),
ELDRAZI("Eldrazi", SubTypeSet.CreatureType),
ELEMENTAL("Elemental", SubTypeSet.CreatureType),
@ -131,6 +134,7 @@ public enum SubType {
FROG("Frog", SubTypeSet.CreatureType),
FUNGUS("Fungus", SubTypeSet.CreatureType),
// G
GAMER("Gamer", SubTypeSet.CreatureType, true), // Un-sets
GAMORREAN("Gamorrean", SubTypeSet.CreatureType, true), // Star Wars
GAND("Gand", SubTypeSet.CreatureType, true), // Star Wars
GARGOYLE("Gargoyle", SubTypeSet.CreatureType),
@ -194,6 +198,7 @@ public enum SubType {
LHURGOYF("Lhurgoyf", SubTypeSet.CreatureType),
LICID("Licid", SubTypeSet.CreatureType),
LIZARD("Lizard", SubTypeSet.CreatureType),
LOBSTER("Lobster", SubTypeSet.CreatureType, true), // Unglued
// M
MANTELLIAN("Mantellian", SubTypeSet.CreatureType, true), // Star Wars
MANTICORE("Manticore", SubTypeSet.CreatureType),

View file

@ -49,6 +49,7 @@ public enum CounterType {
CREDIT("credit"),
CRYSTAL("crystal"),
CUBE("cube"),
CURRENCY("currency"),
DELAY("delay"),
DEPLETION("depletion"),
DESPAIR("despair"),

View file

@ -168,12 +168,8 @@ public final class Predicates {
@Override
public boolean apply(T t, Game game) {
for (Predicate<? super T> component : components) {
if (!component.apply(t, game)) {
return false;
}
}
return true;
return components.stream().allMatch(predicate -> predicate.apply(t, game));
}
@Override
@ -196,12 +192,7 @@ public final class Predicates {
@Override
public boolean apply(T t, Game game) {
for (Predicate<? super T> component : components) {
if (component.apply(t, game)) {
return true;
}
}
return false;
return components.stream().anyMatch(predicate -> predicate.apply(t, game));
}
@Override

View file

@ -38,7 +38,6 @@ import mage.abilities.keyword.special.JohanVigilanceAbility;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureForCombatBlock;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
@ -655,7 +654,7 @@ public class Combat implements Serializable, Copyable<Combat> {
Map<UUID, Set<UUID>> mustBeBlockedByAtLeastOne = new HashMap<>();
// check mustBlock requirements of creatures from opponents of attacking player
for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), player.getId(), game)) {
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES_CONTROLLED, player.getId(), game)) {
// creature is controlled by an opponent of the attacker
if (opponents.contains(creature.getControllerId())) {
@ -1180,6 +1179,7 @@ public class Combat implements Serializable, Copyable<Combat> {
//TODO: handle banding
blockingGroups.get(blockerId).attackers.add(attackerId);
}
// "blocker.setBlocking(blocker.getBlocking() + 1)" is handled by the attacking combat group
}
}
@ -1392,6 +1392,7 @@ public class Combat implements Serializable, Copyable<Combat> {
}
public void removeBlockerGromGroup(UUID blockerId, CombatGroup groupToUnblock, Game game) {
// Manual player action for undoing one declared blocker (used for multi-blocker creatures)
Permanent creature = game.getPermanent(blockerId);
if (creature != null) {
for (CombatGroup group : groups) {
@ -1404,7 +1405,26 @@ public class Combat implements Serializable, Copyable<Combat> {
if (creature.getBlocking() > 0) {
creature.setBlocking(creature.getBlocking() - 1);
} else {
throw new UnsupportedOperationException("Tryinging creature to unblock, but blocking number value of creature < 1");
throw new UnsupportedOperationException("Trying to unblock creature, but blocking number value of creature < 1");
}
boolean canRemove = false;
for (CombatGroup blockGroup : getBlockingGroups()) {
if (blockGroup.blockers.contains(blockerId)) {
for (UUID attackerId : group.getAttackers()) {
blockGroup.attackers.remove(attackerId);
blockGroup.attackerOrder.remove(attackerId);
}
if (creature.getBlocking() == 0) {
blockGroup.blockers.remove(blockerId);
blockGroup.attackerOrder.clear();
}
}
if (blockGroup.blockers.isEmpty()) {
canRemove = true;
}
}
if (canRemove) {
blockingGroups.remove(blockerId);
}
}
}
@ -1412,6 +1432,7 @@ public class Combat implements Serializable, Copyable<Combat> {
}
public void removeBlocker(UUID blockerId, Game game) {
// Manual player action for undoing all declared blockers (used for single-blocker creatures and multi-blockers exceeding blocking limit)
for (CombatGroup group : groups) {
if (group.blockers.contains(blockerId)) {
group.blockers.remove(blockerId);

View file

@ -32,7 +32,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionUntapNotMoreThanEffect;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.players.Player;
@ -53,7 +53,7 @@ public class DovinBaanEmblem extends Emblem {
class DovinBaanCantUntapEffect extends RestrictionUntapNotMoreThanEffect {
DovinBaanCantUntapEffect() {
super(Duration.WhileOnBattlefield, 2, new FilterControlledPermanent());
super(Duration.WhileOnBattlefield, 2, StaticFilters.FILTER_CONTROLLED_PERMANENT);
staticText = "Your opponents can't untap more than two permanents during their untap steps.";
}

View file

@ -60,12 +60,15 @@ import mage.target.TargetCard;
import mage.util.CardUtil;
import mage.util.GameLog;
import mage.util.ThreadLocalStringBuilder;
import org.apache.log4j.Logger;
/**
* @author BetaSteward_at_googlemail.com
*/
public abstract class PermanentImpl extends CardImpl implements Permanent {
private static final Logger logger = Logger.getLogger(PermanentImpl.class);
public class MarkedDamageInfo {
public MarkedDamageInfo(Counter counter, MageObject sourceObject) {
@ -699,6 +702,10 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
}
}
}
if (getSpellAbility() == null) {
logger.info("FATAL : no spell ability for attach to permanent: " + getName());
return;
}
if (!getSpellAbility().getTargets().isEmpty() && (getSpellAbility().getTargets().get(0) instanceof TargetCard)) {
Card attachedToCard = game.getCard(this.getAttachedTo());
if (attachedToCard != null) {

View file

@ -0,0 +1,50 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
*
* @author ciaccona007
*/
public class GiantChickenToken extends Token {
public GiantChickenToken() {
super("Giant Chicken", "4/4 red Giant Chicken creature token");
cardType.add(CardType.CREATURE);
color.setRed(true);
subtype.add(SubType.GIANT);
subtype.add(SubType.CHICKEN);
power = new MageInt(4);
toughness = new MageInt(4);
}
}

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